How to Remove a User from a SharePoint Site
This will completely remove a user from the site’s UserInfo list:
A user or guest may appear in people searches and in the SharePoint Online Management Shell when you use the Get-SPOUser cmdlet. To completely remove people from the SharePoint site, you must remove them from the UserInfo list.
Browse to the site collection that the user or guest visited, and then follow these steps:
This option is available only if the user previously browsed to the site collection. They won't be listed if they were granted access but never visited the site.
1. Browse to the site and edit the URL by adding the following string to the end of it: /_layouts/15/people.aspx?MembershipGroupId=0
For example, the full URL will resemble the following: https://nuwildcat.sharepoint.com/Sites/test/_layouts/15/people.aspx/membershipGroupId=0
2. Select the person from the list, and then on the Actions menu, select Delete Users from Site Collection.