Doflamingo's downfall is going to be his overconfidence, in himself and his crew. It's definitely not a bad thing to have, but it has its pro's and con's. In this case, we know he's going to be defeated, but I think in regards to "in-universe", him and his crew staying stagnant (as Law pointed out about the two years), will also play a part.
Doflamingo basically has no one pushing his limits as a pirate anymore, at least not in the last ten years since he became King of Dressrosa that we know of so far, and any pirate sort of needs rigid competition to progress. He's still up there in terms of power and influence, like a poor man's Yonkou so to speak, and he's done splendid as a Shichibukai.
I think Law looked up to Doflamingo when he was a legit pirate sailing the seas while standing up to Celestial Dragons, Marines, and the World Government, but he lost his admiration for him somewhere down the line (cue Cora-san) and just basically hated him enough to die trying to kill him. I wonder when we'll see Doflamingo's past and his friendship with Law. It's not like we have to, after all, we didn't see Moria's or Crocodile's, but I think we will sometime later in the story if not this arc.
I also think what sets Doflamingo apart from Luffy is fear, or the lack of it. Kaido strikes fear into his heart and soul, something that will never phase Luffy as he's directly aiming for the Emperor's head while declaring war against another, Big Mom, plus having a deep animosity towards yet another one, Blackbeard. Luffy seems better equipped to take the title of Pirate King than Doflamingo, who like Blackbeard, seems to want to get to the top through tricks, almost like avoiding the adventure that should be attached to the journey towards the summit.
It's sad, I think Doflamingo was one of the true candidates to become the Pirate King, but he got caught up with how he was doing thus far in his pirating career and was fine with it. People like that have no room to attain the Throne, that's why I think this middle generation (also: changing of Yonkou titles) is being phased out for the next, because it's been too "stable and comfortable" for too long, no one has done anything, yet something has to give with Luffy's generation pushing through. We'll see that when we're done with this arc along with the next two.
Just some stuff I've had on my mind.