I'm trying to prevent apps from accessing other devices on the same network (LAN). Something similar to this iOS setting.
Some searching led me to this feature in Express VPN.
Is there a way to do this in Android Settings or using a non-VPN app?
My LAN is protected by firewalls. That's the only real solution if you want a real protection. Each computer on the LAN can have its own firewall preventing connections from the outside. Only let the very connections you are interested in happen (if any, I like to have access to my local Apache2 where I store some info. I like to access).
It will always be possible to circumvent protections on a phone if you're a good hacker. Firewalls on the other end requires a possible hack to penetrate that computer, somehow. Not very likely if you do not have any services (completely block all traffic) since that would mean an exploit in the firewall/network stack.