What is going on grammatically with this embedded interrogative clause:
In court he was wearing a navy-blue polo shirt—possibly what he was taken out of his home wearing.
The reference is to an indicted person who was arrested by police at his home.
An analogous sentence without the passive in the embedded interrogative clause:
She was found wandering the streets in a yellow dress and matching hat decorated with yellow roses—possibly what she went to church wearing.
P.S. Here are some similar clauses:
That's the tree I broke my arm climbing when I was a kid.
This is the medicine I get dizzy taking.