Depends on the player. For example, the Avs are going to be forced to give Mackinnon an 8x12M+ deal here very soon... We all know(Well, the ones who aren't extremely bias anyway) that contract isn't going to look pretty when the 2nd half of it kicks in and Mack is 32 years old. But on the flip side, re-signing Kadri would be a huge mistake. Re-signing Devon Toews in 2 years from now will be a mistake(But I dont think we'll have a chance at that anyway).
I'd agree for your absolute franchise players, you just have to take the hit and sign the contract. Especially if your window is still perhaps open, like the Avs will believe it to be.
But I dont think the Blues made a mistake passing on Pietrangelo at all. In fact I think they are looking like geniuses at this point and only speak further to the idea that sometimes you just have to walk away when it doesn't make sense. You say the Blues would be an "actual cup contender" with Pietrangelo, yet the team that signed Pietrangelo to that 8.8M deal is on the outside of playoffs looking in this year despite being though to be the #1 contender, Pietrangelo is already starting to experience falloff, and the Blues are 2nd in the Central, 7th in the entire NHL for points this year.
Not signing Pietrangelo enabled them to improve the forward depth on that team by trading for Buchnevich, and improve the overall depth of the Defense.
I think signing Erik Karlsson to the contract he got was a huge mistake for the Sharks, especially given his injury history. I think it was clear his ankle was in really bad shape and he wasn't going to be the player he was for Ottawa in years prior going forward. But Doug Wilson also put himself in a really bad spot by trading as much as he did to get Karlsson, and at that point you kind of have to sign him to save your job basically. You trade that much away for him and then dont sign him, you're fired the next day.
Ultimately it comes down to just no franchise being perfect.