Your 2 channel relay seems not having any optical coupler to isolator to reduce/prevent back EMF spikes going back to the Rpi's power supply and thus mess up the python program. Perhaps you should replace it with a relay with the following features: (JD-Vcc jumper, for total optical isolation, (2) Optical couplers.
If i turn on the 12 V first in that case the Raspberry Boots up , the RFID scans for the first time and then stop working for the second time. For this one i had a plan to restart the script each time someone scans the RFID but in that case it says that the GPIO Pins are in use