Sorry about the pict with no description.
I made a panel out of Luan(v. thin) plywood. It's thin enough to allow normal bunk operation & stiff enough to provide a fence to keep a sleeper from falling to their death. There's another piece of equal size that you can't see--I made a hinge of packing tape to join them. The part under the mattress supports the fence fine and they fold down to make a thin enough package for raising the bunk. Hope this will help.
Maisie: 2019 Newmar Bay Star Sport 3014: front & rear CHF, SafeTPlus, DIY track bar & stair storage. Sparky: 2017 Chevy Spark using Blue Ox tow bar. 2013 Thor ACE 29.2
It is a mistake to allow any mechanical object to realize that you are in a hurry.