How exactly does one lock themselves in a cage? An unlocked door stays unlocked, no?
If you mean being arrested by guards and having items confiscated, then no.
If there's another mechanism involving cages and lost loot, then, once again, no
There's a ruin where you can fall through a grate in the floor and become trapped in a cage with an Expert or Master lock. Outside of it is a mage who has the key and, if you don't kill him close to the cage and run out of lockpicks yourself, you could become trapped...if you're not on PC...though reloading an earlier save and watching where you step helps.
I don't remember the name of it, though.