Try a stepwise approach. Take apart your BAQ, and run each subquery as the top level to ensure each subquery returns the expected values. If a subquery returns duplicates, resolve them until each subquery returns only unique records. The only way I found to resolve them is to try to filter down each subquery to return the fewest results possible (and still get the outcome you need).
Go into your BAQ > Actions >Execution Settings. Add a new Setting Name = ShowStatistics, Setting Value = True. This shows some useful information about how many records are pulled from the various tables in your BAQ. I found that some of my huge slow BAQs have record counts in the millions, when I was only returning a few hundred rows. After I rearranged my BAQ to return the minimum rows in each level, the whole thing became lightning fast. It is so satisfying to get it right. Keep trying!
Tracking Down a Speed Issue - Kinetic 202X - Epicor User Help Forum (epiusers.help)
Lots of good tips in this thread.
Good luck!