There's no denying that the phrase there is a God is in use, as shown in these examples.
When the nefarious Cardinal Richelieu died in 1642, Pope Urban VIII is said to have declared: “If there is a God, the Cardinal de Richelieu will have much to answer for. If not … well, he had a successful life.”
...
Pope Urban had it right. If there is a God, Kissinger has much to answer for.
If there is a God — and Doyle fervently believed there is — “One Long River of Song” will change all that.
Granted, the phrase should be grammatical given that we have many of these attested example written by educated writers, but I've got some questions about the use of the indefinite article a along with the capitalized God.
The first question is whether God here is a proper noun or a common noun, which is nicely answered by @nohat in a 2010 ELU post:
To summarize the proper noun/common noun usage, I think the easiest way to handle the situation is to capitalize the word god when it is used as a proper name as the name of the god of a monotheistic religion, such as the god of Christianity or Judaism, and not capitalize it when it is used as a common noun:
So it looks like God here "is used as a proper name as the name of the god of a monotheistic religion, such as the god of Christianity or Judaism".
Then comes the second question: If it's a proper noun, how could you possibly add the indefinite article?
Grammatical names aside, does a God still refer to "the god of a monotheistic religion, such as the god of Christianity or Judaism"?
Moreover, the following article even has the expression that God:
If, as many people believe, there is a God, and that God made us in his own image, then of course we are distinct from nature, just as He is.
So, now you can add the demonstrative determiner that as well as the indefinite article before a proper noun. What's going on here?
Considering all this, I'm not sure I even understand what the phrase there is a God is supposed to mean. Please help.
Here's a new example worth considering: The New York Times, 2022:
Is there a God? If there is, can we interact with him, her or it? If so, how? Can God speak to us? Can God say no to us?
Here, the writer initially wrote a God, but then changed it to just God without any article. Apparently, the writer is referring to the same entity. What does this tell us?