How can you have phases of the Moon that do not correlate to positions of the sun?
Have you seen photos of a partial Moon when the Earth is not in position to cast the shadow on it by blocking sunlight coming from behind the Earth where the sun should be?
Simple, the Earth's orbit around the Sun and the Moon's orbit around the Earth are not synchronised. In addition, various factors create occasional unpredictable wobbles in the orbits. For instance, the Earth's axis does not always remain constant, so the relative position by which we see the constellations changes.
The only time when Earth casts a shadow on the Moon is during a lunar eclipse.
Phases of the moon are the part of the moon that are facing the sun as viewed from Earth, so when has the Sun ever lit up the part of the Moon that wasn't facing it? If it ever has that might be a good thing to know about because that would be really big news!