Gate is not connected to source or drain. See below. If connected your way, you are just using the built in diode, not a cheap way to get a diode.
Several Circuit design considerations:
The IRF530 is Not a good choice. It's 0.115 ohm.
A 10a load, the MosFet drops 1.15v, worse than the diode.
At 40a much worse. Actually way beyond it's 14a rating.
If you already have this MosFet, Parallel several. until you get the ohms desired.
(source of each connects together, same with drain and gate, they must all be the same device, do not mix).
For the plus 12v wire the MosFet must be P-channel.
Neg wire – N-channel.
Many MosFet would be a good choice, Look at the ohm's the device is rated at.
Surplus stores have 10 power MosFets for a low price...
Power = I * I * R, the smaller the R, the lower the power losses.
Your goal in useing the MosFet is to get the P loss much lower than the Diode.
I mentioned Solar before, at $4/w, an active rectifier can save several watts, the cost is much lower then $4/w, so as long as you can make use of the power savings it is a good value. Even using the Scottky diode at half the power loss is a good value. The reverse voltage rating on Scottky diodes are much lower than regular diodes.
To use a MosFet as an active diode, connect the MosFet Source and Drain pins as if it was a diode, so the built in diode conducts with the direction of desired current flow, this is considered backwards for most applications. The gate is tied to ground for P channel, N-chan goes to positive. The voltage between the gate and source MUST NOT ever exceed it's rating. Most are rated 16v, some 20v. The gate is very fragile, easily damaged by any over voltage, No mater how short. Protection of a zener across Source Gate with a series resistor on the gate circuit can be used (recommended). The series resistor must keep the current low so as not to exceed the power rating of the zener diode, when dealing with the highest voltage expected.
I have used this method for years. I design battery powered electronics. We want the max power out of the battery. So I use this active diode as a reverse battery protection. Only on the pos wire. Works very well. Adds considerable run time to a battery pack.
If you have any questions about how this works, draw up what you think I mean, we can all look it over, as we have been.
Have fun.