FYI - You can’t use Dynamic Groups for Custom Directories. It throws an error. The support article you posted actually mentions this as well - “Note: Dynamic Groups cannot be added to a custom directory.”
I saw your post, it was exactly what we were trying to do. Spent a bunch of time creating a dynamic group exactly how I needed, and then ran into that error
Just posting in case it’s helpful for someone else.
We have a third-party service that syncs to Google that we can create Groups in, that will stay updated that we are going to leverage to make Groups to limit Directory Visibility.