With any electrical problems on these cars you have to completely eliminate it being a low battery before wasting time looking elsewhere, have you voltage checked it after a being sat a for a few days? With a volt meter you are looking for at least 12.4 Volts on a good battery. Anything less will cause problems.
It looks like you have eliminated the bonnet switch and information code 8A relates to interior alarm activation, so I would be suspecting other sensors and connections like the tilt unit (in centre consul or combined with the siren depending on model) locking fuel cap activator / switch (will be inside the boot, possibly damaged when people pull the flap when locked?) or the alarm siren (rear wheel arch behind arch liner) or the GM5 locking control module (behind glove box) this communicates locking status to the alarm system. I'd always be focusing on any areas which have had damage, aftermarket kit fitted, water ingress or repairs first. Happy hunting and let us know if you crack it
TIS re Tilt unit https://workshop-manuals.com/bmw/z_series_e85/z4_2.5i_n52_roadst/2_repair_instructions/65__audio_navigation_and_information_system/75__anti-theft_alarm_system/1_ra__overview_of_control_units_modules/
Tilt and siren http://www.unofficialbmw.com/images/6115EN.pdf
GM5 https://z4-forum.com/forum/viewtopic.php?f=34&t=102586