I've had the same issue recently: a quit and a join were merged onto the same line, in a normal channel window. This was with the default output, i.e. no scripts replacing the output. The timestamps showed that several hours had elapsed between the two events. Similarly, $line returned the concatenation of the two lines. Copying the line still yielded a single line on my clipboard. The channel's log file contains the right text, that is, with the two events each on their own line.
This was with 6.35, so whatever bug this is, it's still present. I have not seen it more than once, though.