The item.sharing.shared_with["groups"] and item.sharing.groups.list() Python variables only return a maximum amount of five groups, while the item.shared_with["groups"] Python variable returns the true amount of groups a feature is in from the ArcGIS API for Python.
This issue is not reproducible with the code. A service is taken and shared with 16 different groups, but the correct number and title or groups is shown for each of the print statements. Testing is done in ArcGIS Pro 3.5 and the associated ArcGIS API for Python in the base environment (2.4.1.1).