I have to admit that this is a tricky situation but the inadvertent whistle came during team B's "control/possession" before the kick ended. So it would be team B's call for replay the down or take the result of the play. Could be wrong, just how I see it.
Yes, this is a bit complicated. But, officially, Team A is still in team possession until a player of Team B gains literal possession, or the ball, loose from the kick, otherwise becomes dead. If all conditions for PSK are met, fouls by Team B
during the kick are 'treated' as though they occurred after Team B gains possession (by player possession, or by being awarded the ball at the end of the down). That's what the expression, "Team B is
taken as the team in possession..." means. It doesn't mean they are actually, or officially, the team in possession; only that, when the down is over, their fouls during the kick are treated as though they were the team in possession when those fouls occurred.
So, an IW during the kick, even while the ball is slowly rolling to a stop with players gathered around watching it, would be required to be repeated, since it occurred during the kick play portion of the down. Nobody has an option in this case.
Move to 2022 Video Review 8, and, by Shaw's direction, in this narrow set of circumstances (boy, does this sound like supreme court judges handing down rulings, or what?), we are to, effectively, ignore the IW, and process the down as though it ended routinely, with Team A illegally possessing the ball (or the ball otherwise becomes dead before a player of Team B takes literal possession of it). This is a very narrow and specific set of circumstances. But they do occur rather routinely.
As officials, we must be focused and alert, and exercise extreme whistle control, at all times, to avoid complications caused by inadvertent whistles and/or signals.