When she appeared in court, she was wearing something like a crown.

Literal

She [topic-は] appeared-in-court [when-とき], crown [like-のような] thing [object-を] was-wearing.

出廷する (to appear in court) is a formal legal compound — 出 (appear) + 廷 (court). ~のようなもの wraps a simile around a vague noun: 'something resembling a crown.' The ~ていた marks the wearing as an ongoing state at the time of the court appearance. 王冠 (ōkan) literally means 'king's crown' — an unusual accessory for a court appearance, making this an intriguing sentence.