Hello, thank you for taking the time to post your question!
The visual discrepancy you end up with is just an illusion of perspective because the solar system is so vast. The phases of the moon we see are simply our perspective of how much of the illuminated side is visible from Earth. Essentially the vast distances of space trick our intuition into thinking the light must be coming from the sun on the horizon.
Hopefully that gets you moving in the right direction! Feel free to reach out with a message if you have any questions beyond that! :)