"It's not like that!" said Harry, and he was so relieved at finally understanding what she was annoyed about that he laughed, which he realized a split second too late was also a mistake.
Harry Potter and the Order of the Phoenix
It seems to me that "a split second too late" is the subject of the clause. But "a split second too late" doesn't look like a noun phrase, and hence it's not a legitimate subject in my opinion. Or we should parse it as "he realized [a split second] that too late was also a mistake"? How should we understand that phrase here?