Wanted to ask if one prayed behind an Imam and later figured that he was not just, does he have to pray again if the qadha time had passed?

No need, even if the time is still there.