Are you certain the temple has to be rebuilt before the Rapture?
No.
The construction though will take a great deal of time, years.
Rev 11:1 Then I was given a reed like a measuring rod. And the Angel stood saying, Rise and measure the temple of God, the altar and those who worship there.
The Temple is substantial and the 2 witnesses prophesy for 1,260 days there. The question is at what point of the Tribulation are the 2 witnesses killed. I believe it is towards the middle. If we then backtrack 5 1/2 years (figuring 2 years for construction) I think the Temple starts to be built before the Rapture.