Totally concur with Legacy. Although there might be a circumstance when Team B might want to take advantage of the “clean hands” provision (they may be winning by, say, 6 points, very late in the game and they may be willing to give up 2 points in exchange for changing field position with the free kick, to improve their chances of keeping Team A from scoring), such a circumstance would be rare. Even then, though, Team A’s penalty is declined, so there would be no enforcement on the free kick.
If the given scenario actually happened, I wonder how the crew arrived at this conclusion. Both fouls were live-ball (neither was a LBFPADBF), so, how did they conclude to penalize the FMM on the free kick? We would need to know if the crew offered offsetting fouls to Team B, or if they just imposed the safety and enforced the FMM on the kickoff.
If they failed to offer B offsetting fouls, then this would be a catastrophic error, with the improper award of a score. If they did offer offsetting fouls, but B consciously elected to invoke the “clean hands” provision, then this would fall just short of a catastrophic error, in that the score would be correct, and the ball was not awarded to the wrong team, but a major penalty is imposed incorrectly.
Crew error. Somebody has to step up and keep this from happening.