What he did to the company to cause employees to resign is unforgivable.
In this sentence , i bolded the noun clause,
and the entire sentence is considered correct with clear meaning.
He made a mistake to cause the employees to isolate him.
But in this sentence, the entire sentence has the same structure as the noun clause above ,
but the sentence is not considered correct or it is ambiguous,
Why and what causes the difference?