People usually drop the pack to go 300 feet off trail to crap or pee. It is easy to get lost if you do not stick a hiking pole with a glove or hat on it twice the frist 150 feet or so. That gives you a directional reference point towards your pack. Better is when you also pull out your compass and follow a straight line, while leaving your “aiming stakes” or Hiking Poles behind you.
When camping at the seashore, it is quite easy to get lost when walking along a long, straight beach at night. Your tent is behind the first or second row of dunes, and you cannot see it from the beach. What I have learned to do is scrape several sets of long lines in the sand with my foot perpendicular to the water. I make a double line pointing at my campsite, flanked on either side by single lines about fifty feet apart. Sometimes, I leave a light stick nearby at the edge of the dunes to mark the location, but these are often missed or stolen.
There was a tragic incident on the Appalachian trail a few years back. A nice lady was solo hiking went off trail to go to the bathroom and then lost the trail. No Cell signal, and they didn’t find her body until a year or two later, inside a tent. It seems she tried to light a signal campfire and was unsuccessful, it wasn’t clear to me she even had matches or a lighter. Very sad.