I just tested this and I can’t reproduce the issue exactly, but we may be testing different things.
Here on meta, I switched the trust_level_4 group’s visibility from Logged on users to Everyone. Before the change, visiting https://meta.discourse.org/g/trust_level_4 returned a 404, after the change it returns the list of members in the group. I have since reversed this edit here so that route is back to a 404 for anons, but changing the visibility works. Also tested the same thing locally.
Is the issue that after changing the group visbility, the group isn’t listed in /groups for regular users? That’s for de-cluttering reasons (it’s not a recent regression, that’s how it was designed in 2017)… regular users can’t join automatic groups, so there’s not much use in listing them in the directory even when the visibility allows it.