In this photo I'm holding a 12 gauge wire so it passes a light switch box and continues up/down. How does the NEC feel about this? should I staple it on either side? Should find a different route?
If it was placed behind the box, how far would it be from the back edge of the stud? Could it be on the other side of the stud? Drilling a hole above and below the box to route the cable on the other side of the stud would be permissible. Or on the adjacent stud?
As long as it's supported within the 1.4m (4 1/2 foot) requirement, I don't see anything wrong with the way it is.
That presumes that this will eventually be covered up by drywall.
If I put it behind the box it would be very close to the edge of the stud. If I ran it like in the picture I would secure it at some point above and below the box and it will be behind drywall.
As long as the attachment point above and below are within 4.5 feet you should be fine as it is pictured.
Listen to Ron. It's FINE.