The only thing the OP was lacking was educating himself of the workarounds for eTA issues with work permits (i.e. asking the airline to enter his passport number into the system which should have displayed that it has a valid one). That one action could have prevented this entire thing.