I had this problem in the Switch version as wel. I saw one post that about this that was marked fixed while it clearly isn't. Raids can spawn underground which is a pain when it happens and is not supposed to occur. Also when I did one recently It said there was only one raider left while there were clearly multiple pillagers still in the cave.
Related issues
Comments

Thank you for your report!
We're tracking this issue in MCPE-45183, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated. Please also read the description for MCPE-45183 carefully before comment there or on this bug.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned. In the future, if you do mention that an issue is already reported, please be sure to provide the ID so it is clear which ticket you are referring to.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki