There's more to it than that. The suffix -ostan is the Persian word for "land." When the Mughals (one wave of the Mongol "hordes") ruled much of southwestern and south central Asia, Persian was the lingua franca and that suffix was used, quite reasonably, to form the names of individual nations within their empire. Hindustan was at that time the name for India; Hindu being the name of the Indus river, phonetically modified over the centuries as the Iranic languages separated from the closely related Indic languages. It eventually came to mean the entire continuum of ethnic groups living there and their religion.
This naming convention persisted until modern times. Turkmenistan is the land of the Turkmen people, ditto for Tajikistan, Kazakstan, Kyrgyzstan and Uzbekistan.
As already pointed out, what is now Pakistan was historically part of the territory of India. But since it is way up there in the northwestern corner, close to the path of the Mughal Invasion, and since along their way the Mughals adopted Islam and then proceeded to spread it everywhere they went, that part of India ended up with a much higher concentration of Muslims than the central and southern part. (Bangladesh was the eastern edge of India and underwent the same process; in fact until the 1970s Bangladesh--"Free Bengal"--was part of Pakistan.)
When Pakistan separated from India in 1947, the two countries differed primarily in religion rather than ethnicity. There's not really any one ethnic group that identifies Pakistan, so they had to come up with a name for the country that was not simply the name of an ethnic group plus -stan. The writer Choudhary Rahmat Ali had published a pamphlet "Now or Never" in 1934 advocating the separation of that region from India. He named it Pakistan, which means "Land of the Pure." That name was an obvious choice for the new country. For the first time (perhaps, I'm not an expert), a country name was coined with the -stan suffix, without the first part being the name of the people who live there.
So... The the people who live in Kazakhstan are Kazakhs, the people who live in Kyrgyzstan are Kyrgyz, the people who live in Tajikistan are Tajiks, the people who live in Turkmenistan are Turkmens, and the people who live in Uzbekistan are Uzbeks. Obviously after decades of Soviet occupation there are a lot of Russian people there too, not to mention there are Tajiks and Kazakhs in Uzbekistan and so forth, but that doesn't stop us from using those names for all of them. Nobody ever uses the word "Uzbekistani" or "Uzbekistanian," even though that might actually be more politically correct.
So here we were confronted with a new country named Pakistan. Westerners just have to be forgiven for automatically assuming that the people who live there are called Pakis.
I have never come across anyone who thought the people who live in Pakistan are called Pakis, not once, not in the UK and not once elsewhere in Europe. I have also never come across anyone respectful using the term in the media, not in the UK, Europe, the US or anywhere else.
People who make such mistakes should not be forgiven in my opinion, they should be mocked and humiliated, if the situation allows for this. Pakistan is a recognised and well-known country, Pakistanis have settled all over the place, the UK, US, Europe, Australia, Saudi Arabia, Canada etc. They are more dispersed then lets say Kazakhs or Uzbeks. There are no excuses in my view.