What can one say to that other than DON'T DO THAT?!!!
When I was down the first time, I did not have a 'foam' topper and my problem was the opposite...I kept literally sliding out/off the bed! When you are weak and well, 'fragile' Getting up is not a vacation! Then with the foam topper, well, that would 'migrate' and again, there would be that sinking 'sliding' feeling? Usually at 3am or so.
I keep my cane by my nitestand so's I can sort of 'push' my body well onto the mattress and same to propel out of same. No wonder my recliner is my snooze place of choice - easy in and out.
I really hope that what you heard was either a muscle stretching or a sort of usual creak. I could send you a supply of bubble-wrap to protect you with, but I fear you would slide in other ways!

's - j