Does someone become a kafir if they stated the prophet peace be upon him was a kafir before receiving the revelation even though this might have happened out of ignorance and not in a means of being disrespectful.
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The Prophets are infallible from disbelief before their mission according to all theologians, but this issue is not one that has an absolute evidence, so the person who disagreed with this is not to be said that he is a disbeliever, especially if he was ignorant as you mentioned, but the truth should be clarified to him.
Taahir ibn ‘Ashoor said in his explanation of the verse about the people of Shu’ayb in which Allah Says (what means): {… or you must return to our religion.} [Quran 7:88]; return: means going back to the place or work where one was, and they considered Shu’ayb agreeing with them on disbelief as a return because they considered that Shu’ayb was upon their religion, as they did not know about him what is contrary to that. So, they considered him as agreeing with them before he called to what he called for.
The matter of those whom Allah wanted to be carrying the prophecy is that they do not do the same thing as the people who have gone astray from their people, but they are before it was revealed to them in a condition of lack of faith until Allah guided them to it gradually. Their people do not know the inward of the prophets, so it is no surprise that Shu’ayb’s people described his being in conformity with them as a return.
This is based on the fact that all the Prophets are infallible from Shirk before prophecy; this is the view of all the Muslim theologians.
Iyaadh pointed out to this in his book Ash-Shifaa’ in Chapter (Section) III and cited the statement of Shu’ayb on whose tongue Allah Says (what means): {… if we returned to your religion.} [Quran 7:89]; the interpretation of return is the fate. This is the interpretation given by many scholars about this verse. The evidence that the Prophets are infallible from disbelief is their perfection; the evidence is that the opposite of perfection before the prophecy is considered a defect, and there is no clear-cut evidence in the Sharee’ah about this.” [End of quote]
Allah knows best.
You can search for fatwa through many choices