Is it OK to allow to more than 16mA (say 1A) to flow through Raspberry Pi GND pin?
Your circuit is OK except for AM7 which is routing all the return current through the Pi's ground which you do not want to do. AM7 is also short-circuiting M1 so all the magnets / lamps will be on all the time (until the Pi burns out). Remove AM7 and you should be OK.



simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. Tidied-up schematics.
Make sure that the Pi GND is connected to the 12 V GND but this is just to reference the two power supplies together. Only a tiny current will flow through that ground connection.