Rebuilding SharePoint owner, member, and visitor groups is critical to restoring normal. Use the link {siteUrl}_layouts/15/permsetup.aspx to recreate the missing groups. Further details can be found at:https://learn.microsoft.com/en-us/answers/questions/526452/sharepoint-online-restoring-deleted-permission-gro
The newly created owner group is not associated with the M365 group owners. If a user is added as owner through the modern permission interface, they do not receive permissions for the site by default. Check permissions.
It is necessary to reconnect the M365 group owners to SharePoint owners. When a team site connected to M365, the M365 group owners are added to the SharePoint owner group.Further details can be found in the article:how the M365 group is associated with the SharePoint groups.We need to run a script.
AfterTo execute the script, the M365 group owners with the SharePoint owner groupconnected.