Does the car even lock when you walk away if you've left your phone in the car? I wouldn't think it would (because it wouldn't detect loss of the Bluetooth signal), and I'm pretty sure it doesn't (I leave my phone in the car when I go to my mailbox and it's never locked on me). And it would not detect the removal (or lack thereof) of a key card since those are only detectable when you put them right up next to the center console (or door pillar sensor).
And I don't think ICE cars have this capability either, or at least not the ones I'm familiar with (granted, it's been awhile). My old Nissan LEAF had a feature where if you tried to lock the door using the pushbutton while the key fob was still inside the car it would beep at you. Is this the kind of thing you are talking about? That's not really the same as what you are asking for as you would normally need your phone to lock the car, so if that is left in the car, it wouldn't lock.
If this is something you inadvertently do frequently and are worried about your car being stolen, I would suggest you use the PIN to drive feature.