Circuit working in breadboard but not perfboard
You connection seems to be like this:







simulate this circuit &ndash; Schematic created using CircuitLab


  The central locking in my car works with 2 wires one at 12V, the other at 0V. When the 12V line is pulled low, the door locks. When the 0V line is pulled high, the door unlocks.


I'm not very clear on this. Do you mean that the 12v and 0v lines you describe are similar to weak pull-up and pull-down lines? Can you connect the 12v to GND without getting a short and that is also the case when you connect the 0v wire to 12v?

Lets go to your circuit.  

M2 section
M2 operates as a low side switch and is able to pull down the 12v line (ground it) when the 5v is applied to the mosfet gate. Assuming that this is what you want to do, it will work fine.

M1 section
The first problem is that in order to use a N-mosfet as a high side switch you have to apply to the gate a voltage higher than the voltage of the drain, so unless the 5v is from an isolated supply (not coming from the car supply) you'll need to apply to the gate more than 12V (about 15V or more).
The second problem is that according to your description you are trying to apply 12v to the 0v line , but what you do is connect the weak 12v to the weak 0v, how can this work?
You can replace the N-mosfet with a P-mosfet and a transistor to control it, but I can't help much without understanding the characteristics of the 12v and 0v lines you describe.



I think it would be safer to just use optocouplers between the car lines and Arduino.  Also a P-mosfet for the high side switch and the N-mosfet for the low side switch.







simulate this circuit