Greetings,
We've been facing the same problem recently and want to share some of our observations in the hope, that they may be helpful.
When I say the issue was fixed temporarily in these bullet points, I mean it works until the next restart - just like when one disables and reenables the permission.
Logging out and logging back in after the reboot reliably fixes the issue.
From the point of view of the app it looks exactly the same as if the permission was not given (NWConnection runs into a localNetworkDenied).
Running another version of the app with a different bundle name sometimes created a second linked permission in the local network permissions and fixes the issue for multiple reboots. Eventually this fix broke down in some cases for unknown reasons.
We once observed a newly created user on a problematic machine not having this issue. On that machine it was fixed with the method from the previous bullet point for another user. We couldn't replicate this behaviour on another problematic machine though - there the issue reappeared for the new user.
The issue sometimes temporarily fixes itself after a few minutes. We opened VLC and TeamViewer connections shortly before it did every time, but that may be coincidence.
One of our customers came up with this shell script (which they configured our software to automatically execute on start), which solved the issue for them (but probably causes to much collateral damage in general):
do shell script "networksetup -listallnetworkservices | tail -n +2 | sed 's/^*//' | while read thisName; do networksetup -setnetworkserviceenabled \"$thisName\" " & "off" & "; done" user name "****" password "****" with administrator privileges
do shell script "networksetup -listallnetworkservices | tail -n +2 | sed 's/^*//' | while read thisName; do networksetup -setnetworkserviceenabled \"$thisName\" " & "on" & "; done" user name "****" password "****" with administrator privileges
We've tried moving the app around. Normally it is in a subdirectory of the user directory. Neither moving it to desktop nor to applications fixed the issue permanently - though sometimes executing it in another place fixed it temporarily. This was very unreliable and I wouldn't be surprised if it was just random. This wasn't done on a clean machine though.
Happy holidays.