N.B. I was debating whether to add an answer to this but I disagreed with the (now previously-accepted) answer that stated the Malaysian fatwa would be used, and wanted to give a more detailed reason why from the perspective of Islamic law.
Looking back on this, I realise it's a bit of an information dump with no real references, but unfortunately it's the result of dumping my short lifetime's worth of lived experience and knowledge onto the page. You probably won't like my answer much, because like anything that's evolved over 1400 years, the truth is a lot less neat, a lot more complicated and way too dry for a "just-for-fun" site like this, in which case I apologise.
My credentials: I identify as Muslim, was raised in an orthodox Muslim household, I've read the whole Qur'an more times than I can count and memorised two-thirds of it, and I like to think I have a decent understanding of how Islam works/how Muslims think.
I'll be answering this question from the Sunni Muslim point of view. Sunnis are one of the two primary strands of Islamic belief, and make up around 85% of Muslims worldwide, with Shi'a Islam making up most of the rest. Between them, they cover ~95% of the Muslim population.
I disagree with the now previously-accepted answer on the basis that the referenced fatwa was given for a Malaysian astronaut from the scholarly instruments of the Malaysian government. The problem with this is that the Malaysian government's fatwas - and this is true of most Muslim countries and their populations - only really hold weight for Malaysians. Most Muslims won't have even heard of it, let alone follow it.
Prominent fatwas in Sunni Islam tend to come from a handful of different places, and which ones you pay attention to tends to be influenced by the maddhab (school of thought) you follow.
There are 4 primary schools of thought which all recognise the validity of each other - Hanafi, Shafi'i, Maliki, Hanbali - with Salafism being the newer reformist strand that rejects the concept of schools of thought entirely (in other words, considers them all invalid).
Saudi Arabia's founding of and heavy influence on Salafism means that by and large, Salafis tend to pay close attention to fatwas from Saudi Arabia and its government. In this sense, Salafism can be considered almost like Catholicism, having one centralised place where most religious edicts come from. The other 4 maddhabs are a lot less so.
If Sunni Muslims make up around 85% of Muslims worldwide, followers of the 4 maddhabs make up at least 80% of Sunni Muslims, and very much the majority - this is something not many realise with the disproportionate reach that Salafism has. Most Muslims today are not Arab, and certainly not Salafi.
Culture and ethnicity
When it comes to which fatwa-publishing institution those of the four maddhabs pay attention to the most, the truth is that it tends to be heavily influenced by your own culture and ethnic makeup. This is because despite Sunni Islam considering all of the maddhabs valid, and it being possible for a Muslim to change the maddhab they follow, by and large most Muslims do not, and the maddhabs continue to be divided along geographical lines like they have for hundreds of years. In other words, where you come from in the world tends to influence how you practice your religion the most.
Thanks to Egypt's own huge cultural influence (think TV, movies and music) on the rest of the Middle East, Egypt's own Grand Mufti has a lot of reach throughout the (non-Salafi, Shafi'i) Arab world, although less than the fatwas of Al-Azhar University, which is far older and far more revered than the Egyptian government (sometimes their fatwas even clash).
If your background is Pakistani like me, there's a good chance you belong to the Deobandi or Barelwi movements, both diametrically opposed to each other yet adhering to the Hanafi school of thought, and that your fatwas come from that respective movement's scholars in the Indian Subcontinent. As far as I know the Pakistani government seems to be unique in that it doesn't have dedicated instrumentation for issuing fatwas, as this is the role that the Deobandi movement tends to take. Most fatwas coming out of Pakistan (and India and Bangladesh) come from the Deobandis, and here in the UK, the vast majority of Islamic religious schools are Deobandi-founded and run.
A local approach
Then it gets more complicated still: for the significant diaspora population of Muslims who live in non-Muslim countries like the UK and the US, fatwas from their countries of origin are often considered irrelevant. For many of them, rather than paying attention to the "official" fatwas of their countries or schools of thought - they tend to look closer to home for a more nuanced approach.
This is possible because Islam is flexible enough in its jurisprudence (known as fiqh) that a fatwa can be given by any scholar who has studied Islamic jurisprudence (known as a mufti). Typically a mufti is the most senior role that an Islamic scholar can study for, and usually involves at least 4-5 years of study in an institution like Al-Azhar or a Darul Uloom.
This approach even tends to be recommended by many prominent Muslim institutions of the four maddhabs, such as Al-Azhar, because it solves a fundamental problem of applying foreign fatwas to an environment outside of that which the Mufti deriving them intended. This is something many Muslim scholars - including those in Muslim countries, warn against - because fatwas should take into mind the principle of 'urf.
'Urf is the cultural context in which a fatwa is derived for, and is considered to be a key factor when devising a nuanced, informed fatwa, because culture influences a great deal. For example, Islam commands modesty (particularly for women, it has to be said) but what exactly constitutes modesty in one culture is not necessarily the same as in another, and a mufti who was born and raised locally has much more understanding of this than one imported from abroad. In this way, orthodox Islam contains a framework for flexibility, to a degree.
This means that outside of Muslim countries, many diaspora Muslims will prefer the opinions of a scholar local to them who they trust (often that scholar doesn't even need to be a mufti, because most day-to-day problems faced by Muslims don't require devising new fatwas and so can be heard by a "lesser" scholar, known as a moulana).
Thankfully, this is the age of the internet, and each major school of thought and movement has hundreds of sites - many of which are run by or employ muftis - dedicated to allowing lay Muslims to ask questions and request fatwas that will allow them to navigate their life circumstances while adhering to their faith.
Here's a Salafi one based out of Syria, a Hanafi-Deobandi one based in the UK, and a US-based one that covers all four maddhabs.
Finally, no matter what your madhhab is and what ethnicity you are, if you're part of a Sufi order, you almost definitely defer to the beliefs of your shaykh (spiritual guide).
Actually answering the question
Bringing this information dump back around in an attempt to actually answer your question, you could probably break it down into something like this if you wanted to over-simplify (and you really have to for something as diverse and complicated as beliefs):
1) If your Muslim character lives in a Muslim country: they will tend to follow the fatwas published by their government's fatwa-publishing instrumentation, or the closest thing to it like Al-Azhar in Egypt, or the Deobandi movement in Pakistan
2) If your Muslim character was raised in a non-Muslim country like the UK or the US: they will tend to seek out a trusted local scholar who's qualified to derive fatwas from religious texts (a mufti)
3) If your Muslim character is an adherent to a Sufi order: they will almost definitely tend to follow the beliefs of their shaykh (spiritual guide)
In answer to the question of how the Muslim Ummah (global Muslim community) as a whole would react, each smaller community would react in their own ways along theological lines.
The most rabidly conservative might deny the destruction in the first place, calling it propaganda and misinformation. The vast majority would probably believe it, and would follow the direction of the scholars they trust in how to continue praying. The scholars would probably agree that praying in the general direction of where Earth used to be is the next best thing, and therefore the closest to Islamic teachings.
It's possible that some may vow to enact vengeance on whoever was responsible, but this is unlikely given that it wasn't a targeted attack and that the Ka'bah was just another casualty of the destruction of Earth. What I think is more likely is that they would mark that dark day in memory and have it become a day of mourning on which to pray extra prayers and make extra supplications, just like many Muslims do to commemorate the slaying of many of the Prophet Muhammad's immediate descendants during the tragic massacre of Karbala.
Something else that others don't seem to have touched on is that the destruction of the Earth and the Ka'bah are key parts of Islamic eschatology, so many Muslims may choose to see these cataclysmic events as evidence that the Day of Judgement will happen any day now.
Yet others might realise that both the Ka'bah and the Earth have been obliterated, and yet life appears to go on with no sign of the Trumpet or the second coming of 'Eesa (Jesus) or Resurrection Day itself.
It could be argued that the premature destruction of the Earth and the Ka'bah directly contradict Islamic texts and scholarly exegesis of them.
For example, the Qur'an states:
The Day when the Earth will be changed into a different Earth, and the heavens as well, and all will appear before Allah— the One, the Supreme.
Arguably, the changing of the Earth into a different Earth would be prevented by the Earth's very destruction.
"And when the trumpet is blown with a single blast, and the earth and the mountains are removed from their places, and crushed with a single crushing, then on that Day shall the (Great) Event befall” .
As a result of these apparent contradictions, these Muslims may cease to be Muslims altogether, or at least have their faith shaken as a result.
All of these would be entirely plausible and interesting avenues to explore for a post-Earth ummah.