What if they go flying, and it turns out A did not have a valid medical?
Then he doesn't have a valid pilots licence either, and couldn't operate as planned PIC in any event.
But if pilot B didn't have a licence, he would simply be a passenger. If anything else happened on the flight, it would be pilot A's responsability. Is Pilot B now somehow legally responsible for being PIC just for being on board and having a licence?
Pilot A signed the booking in sheet at the airfield on arrival. Is this a legally binding document to state he was PIC?