Having read this thread and it's references to more contempoary conflicts, can I suggest two from the past that illustrate defeat can happen for a first rate power.

The Russian Civil War 1917-1922 (?) led to massive Great Power intervention against the Bolsheviks. For all sorts of reasons each power withdrew and the Bolsheviks / USSR won. Does this rate as a defeat?

The Second Boer War, with a series of defeats for the British forces at the start, then victories and the dispersal of the Boer forces, who then followed a guerilla campaign - which took even more resources and time to end. The Boer guerillas used the support from the rural Boer community to fight on and led to "concentration camps" and many tactics seen in COIN since.

I will now sit back in my armchair.

davidbfpo