I agree with sweetonsno. Unless there is a company policy about switching shifts, then B can't forcibly change A's plans as a thanks to her. She now, if anything, owes A more than what she originally did.
Ringing up and telling someone that you're taking their shift tomorrow (short notice!) out of the blue would be incredibly rude on its own. I see no reason why, if someone had done you a favour in the past, it made being rude to them like this acceptable.
If A felt pressured into giving B her shift and B was aware that A didn't want to (but pressured her into doing it anyway), that is workplace bullying, which the boss should know about and deal with.
tiggnduff, B was very much out of line. I hope A now realises that similar favours for B will be 'repayed' in this way, and will abstain. The boss definitely needs to know about the fact that B bullied A into giving up her shift, losing A money, under the guise of repaying a favour.