Before I started praying, I intended to only recite surah Al Hamd because the shortness of time, but on the way to third rakaah, I realized that I was wrong. I apparently had time to recite the other surah, the end time that I initially thought was another prayer time, not the prayer I was doing. Do I need to redo the prayer?

Your prayer is valid