Your teacher is correct. You are informally correct too.
The nominal clause serves as the object of the verb 'know'. The noun-clause marker 'what' comes first in the sub-clause, the verb comes last, and the rest of the clause is in-between.
What is at the end of the rainbow --> what at the end of the rainbow is