This would need to checked to confirm:
With this tank (gas) there are limited items causing this symptom. A gas pressure issue (unlikely) or a defective dip tube.
The dip tube is on the cold inlet and feeds water to the bottom of the tank to be heated while the hot water rises to top. When the dip tube is defective it drops cold water in the top instead which bypasses to the hot outlet.
You will need to have the dip tube removed to verify.