It is. You don’t lose the air in the shock/fork/tyre as it has a one way valve.
The ‘travel’ in the valve is such that it is closed before you can detach the head.
If you look at the threads on most shock pumps, they are quite long, and so they take longer to remove, introducing more travel allowing the one way/non return valve to fully close.
You lose the air in the pipe, and then when you reattach the pump, the pipe fills with air from the shock/fork/tyre before you pump and so of course you lose some pressure initially.
Caveat to this can be clip on type Schrader valves or old school flexi pump valves where you fumble and remove them slowly from the tyre (you only have screw on ones in high pressure situations)