We understand that it's not possible to receive all the collection ids due to performance considerations, and that's why the inAnyCollection comes to help. The issue here is that the inAnyCollection is part of the contract and between the app and Shopify, runs on the Shopify end, and we don't have access there to the offers that are defined on the app backend.
I hope that makes sense, and let me know if there's any additional input that can help on my end.
Your question got me in the right direction to achieve this for a Discount Function. Maybe it can be done in your scenario too. I know this is an old question, but maybe it can help others that get here through search engines.