When you are seeing a continual loop "Gathering Favorites/Analyzing Scenes/Detecting Duplicates" it does not mean Photos has got stuck. Photos is just needing a lot of time to finish this process. For my library with just 50000 photos and videos it took three month. For a small test library with 2000 items it took three days, even with keeping my MacBook Air with an Apple M2 chip connected to power and running at all times . Now you can estimate, how long it will need for half a million photos. As some of the tasks, like arranging the layout or finding duplicates are requiring to compare all photos against the other photos, the computation time will not just increase proportional to the number of photos in the library but with a higher complexity. My Mac barely managed to complete this between system upgrades.
Keep your MacBook Pro connected to power at all times, so it can finish the task. The "curating" will have to run again anyway, whenever we change the something in the library, that will change the the layout - like importing additional photos, adjusting the dates or locations of older photos, deleting photos, changing the favourite mark, cropping photos, retouching or adjusting the photos. Doing any of this may kick off the curation again. I am starting to be concerned, when I am no longer seeing "Curating photos" running - I am expecting to run at all times.
But as to your initial question - if you are having items in your library, that Photos cannot scan, because the format is no longer compatible with your current system version, this can block the "curating", as Photos will not be able to recognize the objects or detect faces.
I checked all items by using brute force. I exported all items as original image files and reimported them in small groups into a new, empty library for testing. I removed any item from my library, that gave an error message, when trying to export it or to reimport it to the test library.
You can also try to search systematically with smart albums for items in an older legacy format and check these items first. How to Weed out Legacy Media in Photos for Mac - Apple Community