This is very similar to the "electric box over sump" question.
I'm finishing the basement, which includes upgrading the breaker box and moving it to a more suiting location.
I would really like to move it inside a small bathroom I am building underneath the basement steps (box would be moved about 10 feet splicing the 4/0 cable).
The box would be embedded in the 2x4 walls I'm putting up against the basement block, and above a macerating toilet. I can make sure the toilet water supply and waste are outside the "protected" spaces of the box.
I guess the other concern is if the toilet is a work obstruction. It has no water closet, just the bowl. I kind of chuckle because the toilet lid would make a great place to set your tools if you do have to swap out a breaker or something. The toilet could actually be unbolted and lifted out if needed for projects that might require better access to the box.
I know codes vary. Is there a general rule for this? It seems very often boxes are put over sumps and I believe this to be less of an issue.