No easy/reliable/good fix for Catalina.
It may be that certain images are mishandled and create database corruption.
Some will recommend creating a new library and importing all pics and re-creating new albums. This does seem to work for some people. But not all.
I've heard that wiping and restoring from a Time Machine backup has fixed the problem for some, but I have no faith in that solution.
I can tell you that I had that problem intermittently on my own Mac. It went away under Monterey.