Unfortunately, the Any Filter query posted by Bob won't work in this case. That query finds all photos that have an AI mask but never had the mask actually computed. That situation would arise with the original versions of LR providing AI masking when you copied masks from one photo to another -- LR would copy the type of the mask (e.g. Sky or Subject) but not actually compute it until you edited the target photo and opened the Masking panel and clicked Update. With newer versions of LR, when you copy an AI mask, LR usually recomputes it as well.
Your situation is different: the AI masks have been computed but you accidentally deleted the .lrcat-data file containing the actual computed masks. The photo metadata (which Any Filter can search) contains references to those masks (the Mask Digest), but the actual contents of the masks in the .lrcat-data file are missing. Any Filter isn't able to detect that situation.
However, you can do the following:
1. Go to All Photographs and select all photos.
2. Do the menu command Photo > Develop Settings > Update AI Settings. For photos that don't have AI masks, it goes about 100 photos/sec.
This isn't super speedy but it's fast enough to start it running and then go get lunch or go to bed. You could use Any Filter to find all photos that have an AI mask, but that would take longer to set up than simply running Update AI Settings.