At most, it was just an unwise thing to do, but I doubt it was truly illegal, and it certainly wasn’t necessarily unsafe. The whole point of a helicopter is that you can operate where airplanes cannot.
I don’t know about the helicopter certification requirements in Canada, but in the US it’s actually a requirement that the training includes off-airport operations.