How to loosen nut without damaging toilet shutoff
I usually use an adjustable spanner to hold the body of the valve when tightening, or loosening, any valve.

This saves so much hassle as the supply pipe does not get kinked or its joint disturbed.

A good tip from the OP in the comments is to remove the knob as this permits a better purchase.

I use the type of adjustable spanner with flat parallel jaws adjusted by a rotating screw:


Borrowed image from https://www.ebay.co.uk/itm/142846365301