Color Bleed

Can someone explain why I get color bleed in my prints? Both of these were printed at the same time and one came out perfect the other didn’t

I had another one were it just dropped black where there was no black to be printed as if maybe it didn’t purge fully before printing the yellow.

I actually tried cleaning up the black so ignore the scrape marks.

My guess is that the one on the left printed first and by the time the second one was printer, all the other color was finally purged from the nozzle.

So any way to prevent this?