Good question!
I think the main issue was realistically out of the 3 young and coming guys we have up front, Kotkaniemi was unfortunately the lowest on the dept chart. With Suzuki needing a new contract next year, giving Kotkaniemi a 4M+ contract after the year he had doesn't send the players the ideal message "No need to do well, someone will pay you for your pedigree". With Montreal, Kotkaniemi was expected to drive a line as we were so desperate for that big number 1 centre which was what repeatedly set him up to fail. So even if we matched that salary I don't exactly envision a scenario where he would have lived up to that salary here in Montreal.
In Carolina, it's different. There's a better core group of forwards and Kotkaniemi, as a supporting cast, can thrive. So Kotkaniemi may very well do well this year and in hindsight it can look like the Habs did a terrible mistake, but I don't think he would achieve the same while with Montreal.