Bad contracts are more of an issue in sports with a hard cap where contracts are guaranteed (i.e. hockey and basketball). Although bad contracts have been commonplace in MLB (some examples already cited) they do not paralyse teams despite being very costly. Some teams with bad contracts and really deep pockets continue to contend after paying the luxury tax. Many NFL contracts are not guaranteed and can be weighted unevenly so as to be less impactful.
Most bad contracts in pro sports occur when an athlete signs a long term contact after the age of 30 and sometimes a few years before if the athlete has high mileage (playing style, injuries etc.). Of course there are exceptions, but most athletes peak in their mid/late 20s and decline at a steady rate after age 32 or so. If the contract contains more years after age 32 than before, there is a very good chance it will be considered a bad contract in the latter years. Long term contracts after several years of high performance usually turn out better than long term contracts after breakout seasons or career years around the age of 30 or later. How many folks now regret the Jays letting Marcus Simien and Robbie Ray go? Many did at the time, but the Jays braintrust knew what they were doing.
I consider the worst of the bad NHL contracts to be the ones for players earning $2 million more than their market value for 3 or more years, or $3 million more than market value for 2 or more years. This can include contracts for very good players. A really good player with a cap hit of $11 million has a bad contract that hampers his team's chance of winning the Cup if his market value is around $8 million a year. Sure he is a good player but with his contract he is not helping his team. To date, teams with one or more players earning $10 million or more per season have not won the Cup. It will happen eventually but it require others on the team to overachieve or play above their pay grade, and maybe even a few lucky bounces and favourable calls along the way. The cap is around $82 million for 20 players. It's tough to put together a deep team that can win 4 playoff rounds if one or more individual players earn 1/8 of the payroll.