This error is due to bad Preview cache.
You need to go to the location of your Lightroom Catalog and get rid of the Previews.lrdata folder (do not delete .lrcat file as that is the main catalog)
Removing the Previews cache will automatically build up the new cache when you will launch Lightroom and start working in it.
By default, the location of Lightroom catalog is in Pictures\Lightroom
Every button on the opening page is frozen is frozen and I am unable to access anything except the OK button on the error message box.
Click on that OK option to close Lightroom.
you need to manually go to the location of your Lightroom catalog through Finder/ File Explorer and get rid of Previews.lrdata folder
By default, the location would be in Pictures\Lightroom folder