Solar tracker not working in sunlight

please re-edit your first post to put your code into a so called code-section

It is very unlikely that your code is causing the malfunction, because it works with flashlight as inteneded.

For analysing if your LDRs are saturated or not by the much brighter sunlight you should add code that prints the values of the analogRead-functions to the serial monitor.

Even a pretty "strong" flashlight might have 500 Lumen of light intensity
Bright sunlight is 10000 Lumen. 20 times more.

Which means all four LDRs are reporting "uaaah is this bright ! Bring me the sunscreen and my sun-glasses!"

Or in ADC-numbers
All four LDRs report ADC-value 1023 (if your microcontroller is an arduino-Uno)
even in case your sensors look under an angle of 45 degrees to the sun.