[fix] Correctly transform incorrect error codes to an Error instance