It's not age. 0% age. Yes, he's old now, but when his decline started he was still in his late twenties.
Diego's famous win over Guida in 2009 was the highpoint of his career, and he went on a rough skid after that. Since he lost his title fight with BJ Penn, Diego is 9-10, and he's pretty much been alternating wins and losses (with a few two fight win and two fight loss streaks thrown in). I think it should also be noted that several of those wins were surprisingly bad decision robberies, including Kampmann, Gomi, and Pearson. Take away bad judging and I only think Diego won one fight after Guida in 2009 until he beat Jim Miller in 2016.
I think his problem has been mainly in the coaching/training realm. He's bounced around different gyms and he's bounced between four different weight classes. He seems to need more from his coaches than other fighters. They can't just teach him BJJ or how to throw a jab, they've also got to be a shoulder to cry on and an emotional support, and they need to help him manage his crazy. He hasn't seemed to refine his skills or add a lot of new tools to his arsenal.