"iMac 2019 3 GHz 8-core Intel Core i5, Radeon Pr 560X 4"
That garbled result is typical of the many problems reported here the last year or so with AMD's 500- and 5000-series GPUs used in Intel Macs. The problem is likely caused by bugs in the GPU's graphics driver. LR's AI commands are very sensitive to these bugs, of which there have been many (which is why the GPU manufacturers release one or more versions every month).
Unlike Windows, the only way to update a graphics driver on Mac is by updating to a new version of Mac OS. Last year, after six months of dozens of reports of problems in this forum, Apple finally released a version of Mac OS that included a new driver fixing the problems. But since then, there have been reports here of continued issues with LR's AI commands.
Apple and AMD don't have much interest in supporting six-year-old Apple Intel computers (AMD doesn't supply chips for Apple Silicon computers). Even if they did deploy a fixed driver, you wouldn't be able to use it because Mac OS 26 (Tahoe) doesn't support your iMac 2019.
Finally, LR inexplicably doesn't let you disable the use of the GPU for its AI commands. So you don't have the option of disabling the GPU in LR's preferences (and then waiting potentially minutes for an AI command to complete).
So the bottom line is that to use LR's increasingly sophisticated AI commands, you'll probably have to upgrade your hardware.