I am not sure (maybe someone can confirm it), but I think one of the reasons Catalonia was pacified was that after a couple of years under french rule realised they were better and have more freedom under Habsburg rule.
IMHO, the best case would be in 1648. With two insurrections, one in Portugal and another in Catalonia, there weren't enough soldiers to defeat both. IOTL the option was Catalonia an leave Portugal. You can choose defeat Portugal alñnd leave Catalonia