I would not use it in your first sentence. You could say, "Do not deviate from the route we have planned (or you will get lost)."
It usually is used when there is something set.
You might want to go to Corpus of Contemporary American English (COCA)
and look up the examples for "deviate from"
I received a citation for "unsafe lane deviation" in Wisconsin. I'm unsure of what it is & if I did it.
I was on a street that curves about 45 degrees to the right, approaching a roundabout. It's a four lane street (2 each direction). I was in the left lane. There were cars directly in front & beside me (in the right lane). A squad car was behind me. On the curve, the officer says I twice touched the center yellow line. https://www.avvo.com/legal-answers/i-received-a-citation-for--unsafe-lane-deviation---1456392.html
Mazda 3 Owners Manual: Lane Departure Warning System (LDWS)
The LDWS notifies the driver that the vehicle may be deviating from its lane.
The system detects the white or yellow lines on the traffic lane using the Forward Sensing Camera (FSC). If it determines that the vehicle may be deviating from its lane, it notifies the driver by flashing the LDWS indicator light (green) and operating the LDWS warning sound. Mazda 3 Owners Manual - Lane Departure Warning System (LDWS) - i-ACTIVSENSE