How can I remove an electrical junction box that is attached to a stud, without damaging the surrounding wall?
Have you tried going to Home Depot and playing with the boxes there? If you find one that matches, you can hold the box in your hands and try to wiggle it out of the bracket. That might help you figure out the right way to extract the box in your wall from its bracket. Even bring a screwdriver to take out the screw.

I always figure that it would be entirely within store policy to buy the box, take it outside and examine it like this without damaging it and then return it so why not just avoid the extra paperwork and do it inside.