I use one of these,
https://www.amazon.com/REAQER-Holder-Preventing-Leakage-Adjustable/dp/B07V6YMPCN
I wrap my hose in a cover,
https://www.amazon.com/JAKIA-Fleece-Insulator-Surface-Comfortable/dp/B089QQBWBR
and the combination basically holds the tube in place while giving some flexibility.
You could also use a magnetic quick connect so that the magnet fails before the machine falls over.
Or, you could use a child safety lock for cabinets or such, and put it in the opposite direction to where the machine would be pulled.
https://www.amazon.com/Cabinets-Drawers-Dishwasher-Adhesive-Drilling/dp/B072KPZMMV
You'll also find that you don't move as much in your sleep on CPAP as you won't be tossing and turning trying to breath.