That's generally something you have to think about before you make such changes concerning googles indexing.
I would not worry too much, those old google search results are now going to get a page not found unless you write as many redirects as you have links in google.
Google will just gradually drop all those pages as you discovered and will index the new just fine. It will take sometime for all those changes to filter through, some you will see in days, others months.
Google nowadays will prefer to index domain/product instead of the longer urls, although it has no problem with longer urls.
This problem occurs OFTEN when seo urls are turned on when NOT previously on the same existing site.
The best tip I can give you to keep google more happy is this.
Some sites when they come up in search will have the main url and the main 3-4 top links they may be categories whatever but they will be visible in google as main links alongside your main url. Usually theese are no more than 4-5 and 9times out of ten those main ones will come up.
You should REDIRECT THOSE main links in your htaccess file with a 301 redirect to the NEW url for that link so google sends you
https://yourdomain.com/category/product or whatever and your redirect goes to
https://yourdomain/product.
Google will accept those 301 redirects and change those main links in a matter of days.
Heres an example redirect
Redirect 301 /category/my-product
https://yourdomain.com/your-product
Heres an example rewrite
RewriteRule ^category/my-product$
https://mydomain.com/my-product [L,R=301]
If your new product IS in a sub category change the path accordingly
RewriteRule ^category/my-product$
https://mydomain.com/mycategory/my-product [L,R=301]
To explain the first part of those is what is INCOMING url from google
second part is where YOU wanyt it to go NOW and you are telling google this is a PERMANENT REDIRECT please index THIS LOCATION.