I reviewed a number of QRHs in my museum of flight from my current and previous carriers I have flown with. Squawking 7700 is part of the procedure for rapid depressurization with anticipation for an emergency descent. This allows the aircraft’s beacon return to standout, thus providing fast efficient separation of other aircraft from the one that’s in trouble.
I have heard fellow airmen in similar situations, reminded by ATC to change their squawk to 7700. It also makes ATC sector handovers easier too.
But reprimanded by the FAA, never heard that one before.