Is it messed up to leave my toddler in my apartment to take the trash out?

I live completely alone in my apartment, it’s just me and my 1.5 year old toddler. I don’t know the area very well where I live and I’m kinda far from from so I tend to let my trash pile up pretty often because of my anxiety and mom guilt about having to take it out. The dumpster is in the parking lot across from my building but I can’t see my apartment door from where the dumpster is. Is it messed up to put my toddler in his bedroom with a baby gate to keep him in there and take the trash out or should I carry him with me to take it out? My grandma made a weird comment when I told her about it and made me feel bad she said I shouldn’t do that in an unfamiliar area but I lock the front door behind me every trip I make, it just still makes me feel so bad and gives me major mom guilt for leaving him inside alone and walking to where I can’t see my apartment🥲

Vote below to see results!