H1B transfer - multiple approvals - port of entry

I have a valid visa and i797 petition for company A, with whom I’m current employed. I have an offer from company B and they have filed for an H1B transfer and I expect to get an approval soon, but I don’t intend to join company B. If company B’s petition gets approved and I travel out of the country for a couple of weeks, can I enter by showing my current employer’s (company A) i797 and visa or will they ask me for company B’s i797 as well. If they do, can I say that I don’t intend to join company B at all? Will that cause any issues?

Yes, you can. You need to give the Company A I-797 at Port of entry to CBP officer, so that they give validity based on that. If you want to join B, then you show the B I-797 approval.
It will not cause any issues…you can have multiple approval notices from different companies, it is up to you to choose.

Thank you. There’s also very little chance that I would be getting the physical copy of the approval notice for company B by the time I return. So there is no chance of the officer asking me for company B’s approved petition at all, is there … if I only show company A’s petition?

Should be fine if you show company A’s approval notice. If asked, you can tell that you are yet to get it. In general H1B petition is employer’s petition and they have right to give it to you or hold it with them…