I don't think that's an actual rule, just very uncommon. My examiner back in 2016 gave me the option.. his only advice was "the majority of my candidates who do their checkride in actual IMC fail, but it's up to you" <- the logic of which is interesting, if you're going to the FAA saying "I'm ready to fly in the clouds!" but then you can't actually demonstrate that.. somehow seems incongruent with me. Granted, I was in no mood to fail that day so I passed the ground and rescheduled the flying part of it.
What sticks out as an obvious "this didn't happen" clue is that generally when you practice unusual attitudes your heading and altitude are going to vary dramatically.. you certainly will not be doing the +/- 100ft and +/- 10* course at that point.. I'm not sure how ATC would handle someone on an IFR plan requesting air work, or just willy nilly bouncing around. Of course the possibility exists they were in one of the (very rare, at least in my experience) legitimate uncontrolled airspace where IMC flight without talking to anyone is permissable