  The origin and composition of ultra-high energy cosmic rays (UHECRs) remain a
mystery. The common lore is that UHECRs are deflected from their primary
directions by the Galactic and extragalactic magnetic fields. Here we describe
an extragalactic contribution to the deflection of UHECRs that does not depend
on the strength and orientation of the initial seed field. Using the
IllustrisTNG simulations, we show that outflow-driven magnetic bubbles created
by feedback processes during galaxy formation deflect approximately half of all
$10^{20}$ eV protons by $1^{\circ}$ or more, and up to $20$-$30^{\circ}$. This
implies that the deflection in the intergalactic medium must be taken into
account in order to identify the sources of UHECRs.
