Montour just signed a similar contract $7.1 x 7 years and he's had 1 season over 40 points and never put up 20 goals.
Montour is a defenceman, you can't compare point production with a forward contract.
But in any case, while there is some risk to this, the upside potential is huge and the Canadiens already have a lot riding on Slafkovsky becoming a top-tier winger, so I don't see the risks as out of line. If Slaf doesn't become a star, the rebuild has bigger problems than him being overpaid.