One could also imagine a setup where you're lying on your side and facing a monitor, keyboard and mouse setup rotated 90 degrees, although how you would make the k+m stay in this position is the question.
Have you ever experimented with such unconventional work setups?
Loosely in your vein, I set up an adjustable mounting arm clamp next to my bed that's attached to the window shelf. On it, I have an old iPad mini that I can adjust above me and watch while laying down. It's quite comfortable to watch videos in bed with a screen I can move to put in perfect position. That said, reaching up to type is the worst part of experience. For consuming video its not too bad, but it wouldn't be pleasant to try and do actual work in that position for more than a few minutes at best.
I'm sure some fancy gaming chairs exist for doing reclined work in a comfortable chair, but I think you're mostly leaning backwards and not looking straight up.
That said, I'd bet there's some disabled people with certain medical conditions who have some kind of specialized setup that works for them to work laying down.
Anyway, I'm all for experimentation, so please try and build something that solves this if you're into it. But I'm betting it's going to be a lot more trouble than it's worth.
https://www.thisiswhyimbroke.com/sit-stand-lay-down-workstat...
http://www.ergoquest.com/zero-gravity-workstations.html
One answer is to just "use a laptop" though personally I hate trackpads. There are other pointing devices such as trackballs though I bet you could put some powerful magnets in a mouse and stick it to a mousepad backed by an iron sheet.
In the end what helped me was a bit of exercise. If the reason is pain, and you can - try exercise.