Do you have a set of wiring diagrams for your car?
There are 6 sets of diagrams that cover the production of the Z3. You need to know the build date of your car mm/yy. Go to the "Resources" section of this forum. See the top blue ribbon on your screen. On page 2 are the wiring diagrams. The build dates that each one covers is on the bottom right corner of the front page. Select the right one for your car.
Go to the power distribution section of the wiring diagrams. With a DC Volt meter or multi-meter in hand, start working your way through testing for voltages. I would start by looking at the ignition switch, which seems to be at the core of your problem, and confirm that things are turning off as designed or that fuses go dead when the key is off as designed.
Good hunting.