A VPN hiding your traffic from the websites you visit relies on substituting the VPNs IP for your own. If you're your own VPN, your VPN's IP is your IP.
I've used self-hosted VPNs running on AWS LightSail to have privacy from wifi operators I didn't trust, but it doesn't work for higher levels of surveillance than that.
For example, if your VPN runs on a server with a dedicated or at least relatively persistent IP and you're the only one using it an upsteam of the server like an ISP or a network of sites could track you cross-site and use that data to deanonymize.
I've used self-hosted VPNs running on AWS LightSail to have privacy from wifi operators I didn't trust, but it doesn't work for higher levels of surveillance than that.
For example, if your VPN runs on a server with a dedicated or at least relatively persistent IP and you're the only one using it an upsteam of the server like an ISP or a network of sites could track you cross-site and use that data to deanonymize.