The loss of Cuba, Puerto Rico and the Philippines was so bad that it led to an intellectual movement called “La Generacion del 98”, the year of the Spanish-American war and as
@Falecius commented was very traumatic to the national consciousness.
Losing Cuba under any circumstances, will be as traumatic as the UK losing the Thirteen colonies, France being defeated at Sedan, the Russian defeat in the Russo-Japanese War, etc.
Cuba was Spain’s wealthiest territory, but it was drifting towards the US since the 1850s, there was significant investment from the US and, it made more sense for Cuba’s landowners and merchants to seek annexation or some form of association with the US. Also, in the 1870s, Cuba was forced to accept Catalan monopoly on textile manufacturing, which added to the discontent of Cuba’s growing mercantile class.
From a purely economic perspective, Cuba was lost well before the Spanish American war, the question here is not when, but how. Spain was fighting an on/off revolt since the 1860s and only issued formal autonomy in 1897, by that time, it was too late.
At most you can get a Dominion-like status, like Canada and the UK, but there are just too many bad memories to see this go amicably.
In short, it is not in Cuba’s landowners and merchants’ best interests to be linked to Spain, and it is not in Spain’s interest to let its richest territory go, so it’ll come down to a fight eventually. That is ignoring the fact the US wanted Cuba one way or another, it had the means, and the island is next door.