发生 cannot take an object directly — things 'happen,' you don't 'happen' something. It's intransitive. Use 发生了什么事 (what happened), not the wrong form with a direct object.
mistakes
Don't confuse 发生 (to happen, always about events) with 出现 (to appear/emerge, about things showing up).