Some of the Verses in the Quran, where Muhammmad (a.s.) is praised and criticized
A muslim has to love Muhammad (a.s.), but this love shouldn’t reach the borders of associationism to Allah (Shirk). To keep this balance, Muhammad (a.s.) is both praised and criticized together in the Quran.
“Nabi (Prophet) is closer to the believers than themselves…” (al-Ahzab  6).
“…who is concerned over you, who is very compassionate only to the believers…” (at-Tawba  128).
“Surely, there is an excellent example (ʾuswatun ḥasanatun) in the Messenger of Allah for you…” (al-Ahzab  21).
“And We have sent you only as a mercy for universes.” (al-Anbiya  107).
“And indeed, you are upon a great moral character.” (al-Qalam  4).
“…Ask forgiveness for your sin, for the believing men and the believing women…” (Muhammad  19).
“If the Messenger had made up some words as if they were Our words, We would certainly have taken all his power from him. Then We would surely have cut his vital point from him…” (al-Haqqa  44-47).
“May Allah forgive you. Why did you give them permission until it was evident to you who were truthful and you knew the liars?” (at-Tawba  43).
“…And do not defend the traitors!” (Nisa  105).
“…And never be of those who associate others with Allah!” (al-Qasas  87).