I was told that I am a non-resident of Canada for tax purposes but a resident of Québec, how is this possible?
Québec has its own separate tax rules, including those for tax residency, and while they generally follow the same ideas as the Canadian government they can vary in detail.
In particular, Québec does not generally follow Canada’s tax treaties with other countries, therefore it is possible to be considered a Québec tax resident and a Canadian non-resident federally. While possible, this is not the norm.