There is a hadith in the Musnad of Imam Ahmad (no. 18596) that is used by Islamist parties and terrorist groups to justify their ideologies:
Prophethood will remain amongst you as long as God wills that it remain and then he will remove it when He intends to remove it. Then there will be the Caliphate upon the way of the Prophethood and it will continue as long as Allah wills it to continue and then he will remove it when He intends to remove it. Then there will be a harsh rule and it will continue as long as Allah wills it to continue and then he will remove it when He intends to remove it. And then there will be a coercive rule and it will continue as long as Allah wills it to continue and then he will remove it when He intends to remove it. Then there will be the Caliphate upon the way of the Prophethood and [the Prophet ﷺ] kept silent.”
While there are multiple versions of this hadith and some of them are authentic, only one of them has the final part that says “Then there will be the Caliphate upon the way of the Prophethood…”. This final part is narrated by only one person (Ibrāhīm al-Wāsiṭī) whose narrations are matrūk (”abandoned”) meaning they are so unreliable as to be unworthy of being cited. Please see the study (Arabic PDF) on this by the hadith scholar Dr. Salah al-Din al-Idlibi.
Since the final part of the hadith is from an unreliable source, we should consider it a fabrication added onto the hadith to change its meaning. The hadith should never be used as the basis for our thinking about Islam’s future. I saw an article on the website of the Islamist party Hizb ut-Tahrir that says belief in the return of the Caliphate is an “obligation” on Muslims. This is just self-serving propaganda that has no basis in the Quran or Sunna.
Another example of someone adding something to a hadith to change its meaning is the hadith that says the Muslims will divide into 73 sects. Someone added “And all of them will enter the Hellfire save one” to its end, in this way completely changing its meaning. See this article for more on that hadith.
What about this:
https://medium.com/@fikrmustanir/does-the-hadith-about-the-5-periods-of-rulership-in-musnad-ahmad-%D9%85%D8%B3%D9%86%D8%AF-%D8%A7%D8%AD%D9%85%D8%AF-and-that-the-last-of-1cb559ff266f