It seems crazy, but it is really no different than sleeping in a hotel room or going camping. You initially are uncomfortable and it takes a bit of time for your brain to acknowledge it is safe to sleep in a strange place. Then you realize you are exhausted and pass out.
And unless you REALLY toss and turn in your sleep, you are as safe as your anchors (and if you are doing this, you know how to make anchors. Or are so incredibly stupid that you are trying to win a Darwin award).