How do I hide the VPN key icon from the top bar?

To hide the vpn key Icon from top bar, run the below command.

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval string:'Main.panel.statusArea.aggregateMenu._network.indicators._vpnIndicator.hide()'

To Show it,

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval string:'Main.panel.statusArea.aggregateMenu._network.indicators._vpnIndicator.show()'

to make it persistent, add the first command to startup applications.

Please note that in any case, if gnome-shell is restarted like Alt+F2 'r' Enter method, you need to run the first command again.