"Definitely a docs issue, clearly written by a really 'clever' person "
I can think of at least 3 cases where I've been dropped in the s**t by some "genius."
One case was down to a MENSA member, so he really was a genius. That I could fix quite easily, although that will fail in about 60 years. When I did it I assumed the code would be junked long before it was an issue. Now I'm not so sure.
The others were completely out of my hands to fix. Why would you not use a case statement for multi way decisions based on a state field?