This is solvable with your 2 year old. Might take a bit of time, but its doable.
You either need to:
● remove the battle of will she/ won't she stay with me while I go up sleep. Do this by always stopping while she goes to sleep. But keep the level of reassurance needed ever reducing, in a gradual way.
Say start sitting on the bed, facing child, hand on chest. Then after a few days a significant on bed, face side on to child, hand on chest until asleep. Then side on and hand on chest knlh even distressed, just fitting waiting even calm. Hand back if needed, removed when calm. Then sat on floor. Hand on chest to reassure, removed when calm. Then stood by bed. Then stood facing away from bed. And so on...
Or
● rapid return. Be very deliberate about the fact you are leaving the room after saying nan night. Have an affirmation, something like "sleep time now, we lie quietly to sleep, nan night". Then set expectations before hand and be completely consistent.
So no faffing. Kiss, say affirmation, leave, close door (and listen through the door). Any movement away from the bed and immediately return. Repeat affirmation, kiss, leave. Repeat over and over and over and over again. It might be a million times first night. Be consistent and see it through, it should get easier over time.