I was finally able to resolve this by following a recent suggestion here and doing a repair install of Windows 11.
Go to the Microsoft download page here:
https://www.microsoft.com/en-gb/software-download/windows11
Choose the option "Create Windows 11 Installation Media".
Once you have the installation files on a USB drive run "Setup.exe". Important: Make sure you choose the option to keep your existing files and apps.
After the installation completes everything that was there before is left intact, including any modifications you might have made to the registry. The indexing problem was fixed and I was able to rebuild the index and index over 200,000 files in a couple of hours.