I was thinking the same thing, but was advised against it by an rv tech I trust. There is the possibility of to much "stuff" inside the cabinet that you would have to deal with.
My thoughts are to maybe make a cubby hole in the back side along the edge of the bed frame. Maybe about 1 foot tall by 6 inches deep. Depth would depend upon the front side. (My TV might take up a good chunk of that space. I'd have to check that part out.) Put a foam pad there. Just enough for 2 pair of feet to extend into and move around. When not in use, you can put pillows, blankets, in there as storage. Might have to brace the "box" like you would for a window if there is structure there.
Be a fun project.