Yes. at least there are many stories about it, for Tibetan meditators. It’s called the “death samadhi”. I don’t know how they know. But some of these meditators don’t sleep lying down like most of us, but rather in a meditation posture. They often sleep in boxes to help keep upright. Here is a photograph of a Tibetan nun in her meditation box which she uses to sleep in
Here is a European nun also in her sleeping box
Seems it’s something you can get used to, surprising though it seems to us, and for them it is a comfortable way to sleep. You’d have to have reasonably flexible legs and knees! I couldn’t do it.
So, if you can do upright sleeping, then dying in an upright meditation posture isn’t so unlikely.
Also, I suppose if you spend much of your life meditating, there is a reasonable chance that you will be meditating when you die. They could also be placed in meditation posture by others.
I’m sure there is more to it than that. The stories go that they can stay in a meditation state even after they have stopped breathing and heart stopped beating. Not rigor mortis. Rather that their body stays in this meditation posture not just for a few hours - but often for several days after they die in the sense as recognized here in the West before. This is said to have happened to Chogyam Trungpa Rimpoche who was one of the first of the Tibetan teachers in the West, so he died in a western hospital, and I don’t know if he got into meditation posture himself or was put into the posture by others - but I’ve heard that one of the doctors who looked after him while he was alive was allowed to feel his heart region during the death samadhi, and said it still felt warm.
If this is real, I don’t know what is going on there in a medical and physical sense.