For my project, I am using a solar panel to power a raspberry pi. The panel is connected to a charge regulator, which will connect to a battery. A DC-DC converter will convert the 12V from the battery to 5V (to power the raspberry pi). The charge regulator can also power the raspberry pi as it has a 5V usb outlet. From what I understand about the charge regulator is that it can still provide 5V even if the battery is fully charged, as long as the panels can provide sufficient power. Therefore, I want to implement a method to switch between the 5V from the charge regulator and the 5V from the DC-DC converter. I also want the 5V from the charge regulator to act as my main power supply such that when the voltage drops, the battery would power up the RPi, but when the voltage increases, the charge regulator would go back to supplying power.
I have been advised a multitude of things such as relays or transistors or diodes (although from my research it seems the voltage drop from a diode would not be ideal for my project). I have come up with a preliminary circuit design, but it does not work the way I want to, which is to say that when I lower the charge regulator voltage, I want the voltage to be 5V from the dc-dc converter. Instead, the voltage drops to 4.7V, which is too low for a Raspberry Pi.
Am I perhaps using the wrong parts in this software or is my design completely wrong? If there's a better way of implementing this with relays, could someone help me with the design as I have never designed a circuit using relays before.
I have been advised a multitude of things such as relays or transistors or diodes (although from my research it seems the voltage drop from a diode would not be ideal for my project). I have come up with a preliminary circuit design, but it does not work the way I want to, which is to say that when I lower the charge regulator voltage, I want the voltage to be 5V from the dc-dc converter. Instead, the voltage drops to 4.7V, which is too low for a Raspberry Pi.

Am I perhaps using the wrong parts in this software or is my design completely wrong? If there's a better way of implementing this with relays, could someone help me with the design as I have never designed a circuit using relays before.