If the description above is accurate, Rider A operated their bicycle correctly, and gave enough clearance to riders still in the paceline.
Remembering that we weren't there in person, there may be some aspects of the ride to improve on. It is generally better for the entire group to be either single or double file. The OP indicated in comments that this was a relatively fast but casual shop ride. It does take time and effort to organize a group of riders, so I realize that this isn't a no-cost action. However, I would respectfully recommend quickly briefing riders on expected behavior before the ride. During the ride, anyone associated with the shop should exercise that authority to try to get the group more organized if they straggle too much - note that it doesn't have to be military-level organization, just setting basic expectations. If you are intending for the ride to have fast sections, it is important that people have a basic sense of how to act in those situations.
It's possible that Rider B simply isn't familiar with usual behavior in pacelines. I suspect that with the decline of road racing, more and more people on group rides might not be very familiar to them. Newer riders, or riders just not experienced with pacelines, should err on the side of observing the group's behavior and copying the norms. Naturally, if the group is behaving too riskily, you should consider dropping out from the ride. Also, in many areas there should be group rides that are smaller or slower paced where you can learn the norms. It may be worth searching these out if you need a place to learn first.
A more detailed explanation
In the group rides I've operated in, which have included fast group rides of this size or larger, the person pulling off does coast to the back. If the norm were not to coast but to brake after pulling off, you would have to sprint to catch back on. Accelerating is energy-intensive. On a fast group ride, you would probably be depleting your (limited) anaerobic capacity to catch back on if you did this. So, if the norm were to brake after pulling off instead of coasting, that would be a recipe for short group rides with a lot of people dropping off.
While Rider B's reaction was wrong, it is entirely possible that they simply did not know better. My perception is that there's been a bit of a decline in cycling clubs, at least in the US. It may be related to the decline in road racing. The latter is neither good nor bad by itself, but if fewer people are racing, then there may be less impetus for organized clubs. Clubs, however, are one major site to learn riding skills.
For ride organizers, it's worth referring to @Criggie's answer as potential best practices for group riding. If the ride is organized by the shop, then there's a clear authority and thus a reasonable basis for the ride leader to step up and say we are doing A, B, and C. I would recommend that leaders set basic expectations. If the group's formation starts to get more scattered (e.g. people get to 3 or more abreast), I'd recommend that you and/or others take efforts to restore formation, e.g. verbally asking riders to do so or move ahead to fill in gaps.
In less organized situations, e.g. century rides/Gran Fondos, you have the problem that there isn't a clear authority, and people may be at their cognitive limits due to physical effort. In this case, if you sense that riders around you are not operating safely, you should strongly consider dropping back (or sprinting to the group ahead). You can consider engaging verbally, but you will need to remember that at effort, your speech could come out (or be perceived as) hostile or patronizing. You are not guaranteed to actually get the correct message across. Thus, it may be less wrong to disengage.
Recommendations for riders new to fast group rides
Fast group rides are fun, but they demand more than just aerobic capacity. You do need some minimum level of skill to operate safely. Remember that it's not just you, others are relying on you to know the basic scripts.
For riders new to group rides entirely, or even if you're just rusty: I'd recommend you step in slowly, and to generally observe and follow the group's norms. I want to acknowledge that in other contexts, people are pushing back on gatekeeping. Gatekeeping is not always socially desirable, but it depends on the context and the tradeoffs. Some cyclists have, in the past, pushed back on what they perceive as lesser riders (e.g. newer, or less physically fit, or not a 'racey' position) riding expensive bikes and equipment. I think this is undesirable on balance. With fast group rides, if you crash, both you and an unknown number of other people may be crashing at a fairly high speed! Thus, you do need to accept some gatekeeping in this specific case. Hopefully, there are a variety of rides at your ability level in your area. Consider shopping around for a slower or smaller ride if you aren't at the level of the ride you want, or if you need practice.
One thing to be aware of is that under physical or psychological stress, we can get tunnel vision which impairs our ability to perceive the full situation, e.g. the location of other riders on the road. I have a feeling this might have affected Rider B. You become less vulnerable to tunnel vision with practice. If you are in a situation where the group ride is a bit fast for you, do be aware that you don't have to take a pull on the front. When it's your turn to pull, you can take a short pull, or even pull off immediately (if in a double paceline, let the other rider know; they will usually stay in their place and the rider behind you will advance). Alternatively, you can generally hang out nearer the rear, and let riders rotating off go in front of you (just let a gap form gradually, and tell the other person to go in front of you). I'm not sure if this might have helped Rider B, but it's worth mentioning.