I've got old motor off and new one in but a big red ended wire appeared loose when old one came out. I'm not sure where it came from! Are there 2 leads connected to the positive terminal of starter motor?
Removing and installing/replacing starter motor (M54)
https://www.newtis.info/tisv2/a/en/e85-z4-3.0i-roa/repair-manuals/12-engine-electrical-system/12-41-starter-motor-with-mounting/BrmkJjW