To get around this – with all doors locked, you get out of the car – the door handle should open the door, it will mechanically move the lock flip button there near the handle – the manual one. the car will know the door was opened.
when you manually move that toggle back, you haven’t used the electric lock switch, so the car thinks the door is in an unlocked state – it was previously opened, and the electronic lock button wasn’t used to try and lock the car.
when the car is running, it disables the keyless access system, and disables the remote on the fob/key – so you can’t use those.