My first question is why would Character B leave the sword? Swords are expensive. Well, okay, not always, but good ones are hard to come by. A sword isn’t going to be some prop a character will just throw away. It’s an old friend, it’s a buddy, it’s an extension of the swordsman. He or she will spend a large portion of their time caring for this sword and maintaining it’s combat readiness. Gear doesn’t care for itself and a weapon that a character will view as part of themselves won’t be left behind.
Besides, if Character B pulls the sword out of Character A then they’ll bleed out faster and die quicker. This was the point of stabbing them, yes? A character who got pinned to the wall with a sword through the shoulder, depending on how close it cut to the joint, may have just lost their arm. At the very least, they’ll have lost the use of that arm. If the sword is buried in the wall, then Character A is at significant risk of doing more damage to their arm and shoulder by pulling it out because they don’t have the leverage to pull it straight out. If they pop it upwards out of their shoulder, then they are at risk for greater injury.
Another character could pull the sword out, this character is most likely Character B, but Character A’s fighting capacity will be cut in half. Unless there’s some major reason why Character A needs to keep fighting such as the world is ending or their loved one is about to be cut down, they’re most likely going to back off or they’ll die right there.
Half of fighting is about knowing when to retreat and you should always be careful about inflicting grievous harm on a character. Their injuries should be meted out carefully to match what the sequence still needs the to do. If Character A was slashed across the ribs, had taken a deep blow to the upper arm, or had their quadriceps cut, they would actually stand a better chance of continuing the fight (though this would lead to long term injuries). If Character A is superhuman, then the rules about what they could or couldn’t keep fighting through go out the window.
Something to think about.