I am trying to prevent my Android phone from google casting to a TV that is on the same wifi network. I read in multple places that VPN could help prevent this by making it look like your device is on a different network, but after enabling the VPN, it looks like I am still able to cast. Is this not how a VPN works?
You’re going to have to configure the vpn app on the android device to route all traffic over the VPN. If there is no option for that, you can use a firewall app to route all network traffic over the vpn tunnel adapter instead of the NIC adapter.
It’s not how a VPN works. Your device that is using a VPN will still have a MAC address (layer 2) and an IP address (layer 3) on the local network. The VPN client on that device just changes the destination IP addresses of all traffic from it. But it doesn’t change address for any destinations that are local (on the LAN).
While saying that a VPN does not change your LAN IP is correct, it has always being my experience that the default behavior for VPNs is to not allow LAN connections to work. My opinion is that your VPN is not working correctly. What VPN are you using?