Kids this age do not have fully developed "impulse control" yet.
Their emotions are not even fully developed yet.
They, at 21 months old, will not understand... perfectly... that they have to STAY in there.
Also at 2 years old, this is a common age where developmental sleep tweaks do happen. Anyway.
You could, have a chair in his room. Then sit there.... and read a magazine (with a book light)... while he is in his bed... winding-down. Read to him... keep things dark and calm. I have done that.
Kids this age, do not do well with abrupt.... expectations. They need to transition.... and takes time to fall asleep. No kid, instantly falls asleep as soon as their head hits the pillow.
My son was in his crib even when 3 years old. He LOVED his crib and slept well in it.
Then one day he told us he wanted to be in a bed. Then we did so. He was ready. And it was fine.
all the best,
Susan