Electrum is a SPV wallet and you have to connect to Electrum server to broadcast your transaction.
Even if you set up your own node it will still connect to Electrum server?
In order to connect Electrum to your own node you will also need to run your own Electrum server. You can follow some online guides to show you how to install a server and connect to your node. If you follow the tutorials correctly then Electrum will only receive and send information through your node instead of using random public servers.