Here's why:
* Noun clauses act as nouns in a sentence. They can be the subject, object, or complement of a verb.
* In this sentence, the noun clause functions as the object of the preposition "at". The judge was stunned *at what?* The answer is "what happened next".
Let me know if you'd like more examples or have any other questions!