Dismissal after homophobic remarks was unfair due to investigation flaws