Praise be to Allah.
Shaykh Muhammad ibn Salih Al-`Uthaymin (may Allah have mercy on him) said:
“There is no sin on a person if he sleeps with his feet towards the Ka`bah , rather the jurists (may Allah have mercy on them) said if a sick person cannot stand or sit, he should pray lying on his side with his face towards the Qiblah, and if he cannot then he should pray on his back with his feet towards the Qblah.” (Fatawa Ibn `Uthaymin, 2/976)
For more details, please refer to the following answers: 21216 , 14033 , 145543 , 66200 , and 69808 .
And Allah knows best.
Comment