When reporting your additional information, please try to be certain that the pillagers really spawned in the cave.
A newly spawned raid's first task is to walk as directly as possible toward the nearest village. If that direction happens to lead them into a cave, they will walk into it and probably get stuck there, unable to find a way to get any closer. This can easily happen, especially in the kind of terrain where caves generate close to the surface and some parts of them have no roof between the cave and the sky. This is not a bug, it's just an unavoidable limitation on what a game meant to run on smaller devices can do: Unless it's running on a supercomputer, pathfinding can only afford to look ahead a fairly short distance before it starts lagging the game.
So before you decide that you're being affected by this bug, take a moment to look back in the direction the raid must have come from (that is, the direction away from the village). If it leads to an opening to the surface and the terrain around that opening is suitable as a place where a raid might spawn, you really don't have good evidence that a bug caused this problem.
If, after considering the above, you decide that the shape of the terrain and the cave is not likely the cause, please tell us whatever you've noticed that makes you think it is a bug. We haven't had a report yet that gives us strong evidence that such a bug exists. That's not surprising because the nature of raids is that they spawn at random times and locations, so being able to reproduce the problem on demand is impossible. But even if we assume there is a bug causing this problem, mixing non-bug cases in with it makes it a lot harder for the developers to know where to look.