Wow, what an extensive reply ... Beyond my general knowledge level, but thanks for the insight!
All I can do from here is see what PHP's iptcparse() function reports, and for the "bad" images, it outputs a lot of additional data, and for the good ones, no. The IPTC data for your JPG's are of course stored inside your JPG's. To complicate the issue further, the data stored inside ["2#219"] tag is encoded in a special manner, thus it is corrupting HTML attributes in the output of X3/panel ... Perhaps iptcparse is buggy, I can't say for sure. I haven't seen this exact issue before.