This has happened several times. Car will be turned off and key taken out of ignition. It will then sound an internal “alarm” sound and light the dashboard like the key is in the ignition and door open. To stop this sound and lights, I re-enter the key in the ignition turn on and off, and then take key out.
Something similar used to happen to me, until I found out I was sometimes pressing the “lock” button on the fob when I took the key out of the ignition.
Your problem may be different, but worth a try.
Another idea, there’s probably a switch in the ignition lock that tells the computer if the key is in or out. There’s one on my Corolla for example, which allows the computer to sound an alarm if I open the door with the key still in the ignition. That switch could be sticking or failing. Less likely, but there could be a problem w/the door switch. Check the lights which normally only come on when the door is open to see if they are also coming on when they shouldn’t.