Do you need to supply higher voltage to a solenoid if using a flyback diode

I used PAINT to move things around a bit.
RED for 12v, purple for 5V
green and black for ground

looks like caps for the 5v regulator need to be added.
looks like the 3V3 is not connected ? it would also need caps.

if the relay is a relay module, you might want to add a resistor on the digital line.

I "FIXED" the errant 5volts to the solenoid, but OP needs to verify.