I have heard that kuhli loaches will lie on the substrate on there side if there are not enough hiding places, but as your fish only do this when they are resting and by the sound of it you have lots of hiding places I would say this is not the reason why they do it lol. Maybe its a way of deterring other fish from eating them by "playing dead" whilst resting