Is the orbit shown in the graphic wrong, or is my understanding of orbital mechanics lacking, having only been influenced by KSP?
It's not an either-or question.
The graphic is "wrong" from the perspective of an Earth-centered inertial frame. That graphic instead uses a synodic frame, a frame that rotates with the Earth's orbit about the Sun. You can tell that this is the case by the fact that the L1 point along with the Earth are fixed. In the roughly one year interval shown in that animated graphic, the L1 point would have made a full revolution about the Earth from the perspective of an ECI frame. The rotation of the synodic frame is largely what's responsible for the apparent spirograph behavior of J002E3 in the graphic. (Other than label changes, the graphic is correct, by the way.) The orbit would look considerably more mundane from the perspective of an ECI frame.
This is where your KSP-understanding of orbital mechanics steers you wrong. While the orbit wouldn't have those neat petals from the perspective of an ECI frame, it would still look markedly non-Keplerian. The object's ECI velocity would make the object appear to be on a hyperbolic trajectory for much of each orbit. Yet it mysteriously turns around and orbits, six times, before escaping. KSP cannot display this behavior because it uses the patched conic approximation.
So why use this weird rotating frame?
This is the circular restricted three body problem, with the added twist of a fourth body, the Moon. I'll ignore the Moon. The circular restricted three body problem asks about the behavior of a body of negligible mass (e.g., J002E3) under the gravitational influence of two larger bodies orbiting circularly about one another. The term "restricted" means the third body's mass is so small that it essentially doesn't perturb the orbits of the two larger bodies.
The synodic frame turns out to be be very useful in analyzing the three body problem. While the third body's energy and angular momentum are not conserved quantities in this frame, a new quantity, the Jacobi integral, is conserved, in this frame.

Objects with little energy ($C_j>4$), depicted in the upper left sub-image, are restricted to orbiting the smaller mass (e.g., the Earth) or the larger mass (e.g., the Sun). There's a forbidden region surrounding the smaller that objects with a large Jacobi integral cannot enter. Objects in low Earth orbit are stuck there, and objects will sufficiently low energy outside the forbidden zone can't hit us unless perturbed by something else.
Something interesting happens with a Jacobi integral of about 3.9: A keyhole opens up around the L1 point. Objects with sufficient energy can enter the vicinity of the smaller mass (e.g., the Earth). This is exactly what happened to J002E3. It changed from orbiting the Sun to temporarily orbiting the Earth by passing through that keyhole.
Another keyhole, this one about the L2 point, opens up with an even lower Jacobi integral. You can see this in the graphic that shows J002E3's orbit. In late October 2002, J002E3 came close to the L2 point. It didn't have quite enough energy and it didn't come quite close enough, but if it had, it could have escaped six months prior to when it did. Instead, J002E3 had to wait another six months when it's strange orbit brought it close enough to the L1 point that it could finally escape.
It's very difficult to see these behaviors from the perspective of an ECI frame. It's quite easy to see them from the perspective of a synodic frame, once you know what to look for.