I think you were quite lucky there, since you didn't actually miss your connection, and QR was not obliged to reroute you.
However, I do believe that QR has a policy of free rerouting if the new destination is within 500 miles of the original destination if there had been a problem or a cancellation. And YUL is within 500 miles of JFK