"In gymnasiums with limited space outside the sidelines and endlines, a defensive player may be asked to step back no ore than three feet." Mason didn't commit a violation. There is no RULE that requires you to stay three feet back. It is just left to the refs to decide if they want to ask a player to scoot back or not in a situation where there isn't much room. The ref asked. Mason complied and then moved back to where he is allowed to be. What's the ref going to do, give him a technical? That this is a conversation is ridiculous.
You're right, it is up to the refs to give buddy room, since there isn't proper space on the sideline. Did they? No. It's the refs fault.
What should have happened was, once the ref saw that there inbounder did not have proper space, the whistle should have blown, and he should back Mason off the line. No foul, no free throws take place. Does it change the outcome, probably not.