I have to admit I never heard of this. I also can hardly believe it. In Austria and Germany receptacles are allowed in bathrooms as long as they have a spring loaded lid covering the entire receptacle when nothing is plugged in. Wooden stud partition walls are highly uncommon, drywall is put up with standardized aluminum profile studs. On my opinion it would be nonsense with solid walls, so if it indeed exists, it can only apply for drywall. At least in Austria this rule doesn't exist.