Auto brightness uses a light sensor near the top of the screen. After a screen swap it can stop working.
1. Turn auto brightness off and on again, then restart.
2. Check the light sensor's holder and rubber were moved from the old screen.
3. Make sure the sensor flex wasn't torn or left unplugged.
4. Some copy screens are too dark over the sensor area. Try another screen.
5. On iPhones, the earpiece flex that holds the sensors must be moved carefully from the original screen.
Test auto brightness every time before closing the phone after a screen repair.