My daughter did that.
MOST kids, at 2 years old, have sleep tweaks.
My girl, at that age, wanted to sleep on the floor too, next to her bed. Or on the living room floor. Fine. She got sleep that way. No biggie.
In some cultures they regularly sleep on the floor.
Its fine.
It is a phase.
So, pick your battles or not, about it.
Turn EVERYTHING off at night, before bed. Even the lights. Make everything quiet and boring.
Consistency and 'routine' is key.
You don't have to lock her in her room.
Would you want your husband to do that to you?
Have a regular 'wind-down' time BEFORE bedtime.... and factor in that time, so that the actual bedtime, does not get later and later....
My kids take about 1/2 hour, before bedtime, to 'wind-down' first. We do not play at that time, we make everything QUIET and turn off everything except for 1 light. Then they get ready, brush teeth, arrange their bed the way they like, they can do quiet things. But only for a little while.
It is all about "transitioning" a child, to the next step, that you want them to do.... and making that a regular routine.
Mostly, its a phase.
It will pass.
Just keep to your bedtime routines, every night... and don't argue with her. Just state things, calmly.
If she gets out of her bed over and over.... don't engage with her or 'argue' about it. Just keep everything DARK and BORING. Let her have all the loveys she needs in bed with her, and make her bed all comfy and cozy... and maybe give her a flashlight for in bed too. That is what we do with our kids.