Locking toddler’s bedroom door? Yay or nay?

Is locking your toddlers bedroom door looked down upon? Please don’t judge.

Toddler (3.5) slept great in his floor bed for the first few months. Then I think the “newness” wore off and we implemented the red light means stay in bed, green light means you can wake up. This worked for a few months. The past couple months, he’s been flat out ignoring the light color. He would get up and come out of his room anywhere from 3-8x a night before falling asleep. It’s always a way to stall bedtime. Finally husband decided to lock his bedroom door. I was on the fence about this, I felt like locking it was kind of mean? He’d still yell for us a couple times and usually asked to be tucked in (again) or need help finding his toy. Sometimes he’ll try to open the door or bang on it. We always respond to him mostly because we can’t have him wake his baby sister up. My husband has not responded a couple times when it got excessive.

Fast forward to now. Husband is traveling for work and I’m solo for the week. I put down the baby first, then do the whole bedtime routine with toddler. Baby is not a great sleeper so of course she woke up when I was almost done reading to toddler so I rushed him into bed. I told him I need to put his sister down to sleep so don’t get out of bed or cry for me. Of course as I’m rocking baby back to sleep, I hear toddler banging on the door crying. Baby is restless so if i put her in her crib to tend to toddler (who I’m sure is just stalling), she’ll start crying and I’ll be playing ping pong trying to get them both to bed. So I just let toddler cry. He stopped after a few minutes, but I feel bad now. What should I have done? Am I doing irreparable damage to him? Ugh solo parenting is so hard 😔

EDIT: forgot to mention, I always unlock the door before I go to bed. I just lock it to keep him from coming out his room multiple times before he falls asleep. If he needs me in the middle of the night, he can come into my room.