Possible mechanisms that could be an answer to the question What natural mechanisms could lead to the unlikely case of the same rogue asteroid or planet passing through our solar system twice? include sequential hyperbolic orbits around two stars.
Suppose instead a small body impervious to disintegration by tidal forces or radiation were to pass very close to a very massive object, perhaps a black hole a bit beyond the Schwarzschild radius at closest approach due to general relativistic effects, then continue on into space.
Asymptotically, could the final direction differ by greater than 180 degrees, such that its outgoing trajectory intersects its incoming trajectory at some finite distance?
This might be called a "hairpin trajectory".
The extent of my exposure to GR is this approximate equation (described with citations in this answer) commonly used to approximate GR effects within the solar system, but I think this question needs to be addressed at higher level and beyond a low-order approximation.
The following approximation:
$$\mathbf{a_{GR}} = GM \frac{1}{c^2 |r|^3}\left(4 GM \frac{\mathbf{r}}{|r|} - (\mathbf{v} \cdot \mathbf{v}) \mathbf{r} + 4 (\mathbf{r} \cdot \mathbf{v}) \mathbf{v} \right),$$
should be added to the Newtonian term:
$$\mathbf{a_{Newton}} = -GM \frac{\mathbf{r}}{|r|^3}.$$