"Is it technically possible that the Captain may have hit the button (intentionally or unintentionally) when leaving the cockpit with the door open or not open yet. Hence activating the lock mechanism (red light outside) without anybody noticing in that moment?"
No, it's not. The switch in question requires one to lift it up with a certain amount of force before it can be moved. It cannot be shifted into another position 'by accident'.