I'm fairly sure the cause of back pain is sitting at desks, not the position I'm sleeping in.
I'm skeptical that there's anything especially unhealthy about sitting at a desk even for long periods of time. What's more plausible to me is that back pain comes from having a weak back and it's more about what you're not doing, which is training your back muscles. Over the course of about a year, weight lifting eliminated a range of aches and pains I'd developed throughout adulthood, including back, wrist and knee…
A lot of people end up thinking it's about ergonomic chairs. An un-ergonomic chair will make things bad pretty quick, but supportive ergonomic chairs are part of the long term problem IMHO.
And deadlifts are not the only solution. I started out using just a backless stool and it helped a bit (can't slouch!), but what really sorted me out was using the "lumbar machine" at the gym for a couple of years. When Covid came along I couldn't go any more so I started doing "the plank" at home, that plus the "side plank" and some push ups have kept me going the last four years. And it's totally free and I can do them basically anywhere e.g. on holiday.