Hold firmly to that belief…. Or else it’s in vain. The condition is holding firmly to the belief or else it’s in vain. Meaning, it’s possible to believe, lose a grip on that belief, and the end result being a loss of belief.
This verse says nothing about a hypothetical scenario of there not being a resurrection. This is about being saved, or a loss thereof, due to apostasy.
1 Corinthians 15
1Now, brothers and sisters, I want to remind you of the gospel I preached to you, which you received and on which you have taken your stand.
2By this gospel you are saved, if you hold firmly to the word I preached to you. Otherwise,
you have believed in vain.
The word that he preached to them, that he is saying is vain belief if they do not hold to it, is that Christ is resurrected.
Resurrection is the whole theme of this passage, it's in vv. 2, 3, 4, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 26, 29, 30, 31, 32, 35, 36, 37, 38, 39, 40, 42, all the way to v. 58
When he's talking about vain belief here he is talking about a wrong belief, specifically a false belief that denies the resurrection.
So this is not a passage about God failing to make good on
His promise to save
us - it is a passage about how belief that there is no resurrection is false, empty belief.