Well, it didn't.
The minimum anyone would have to accept is that the economy went to shit while mass immigration was happening ... (in both EU and Canada). So I guess you don't have to accept causation, but they were happening simultaneously, so this reaction by the population is justified in that sense.