I had this problem with my old 3 series BMW after it sat on my drive for months unused. The battery was so flat, there wasn’t enough charge to allow the central locking to operate and so the mechanical lock wouldn’t function.
Having tried everything they could, the RAC were about the break a window, when I realised my bonnet catch wasn’t properly locked and we managed to get it open.
Once hooked up the the RAC van the door locks worked fine, but the battery was so flat, it wouldn’t take a charge and so a new one was fitted.
Try to keep up with trickle charging now, as with the pandemic, I’m prioritising using the van for run outs over the old car.