I think you are following a old guide here https://bitcointalksearch.org/topic/guide-solo-mine-testnet-bitcoins-with-cgminer-bitcoin-core-and-a-compac-f-5415335
This no longer works in mainnet if you want to mine solo in your node you might need to host your own pool to be able to mine BTC it's resource-intensive so if you just have a USB miner it's not worth it than mining directly to solo pool like CKpool.
Actually, it does mine to mainnet if you set it up correctly.
Read to the end of the thread, its something that I've done. https://bitcointalksearch.org/topic/m.64141558
I took Kano's 4.12.1 and merged in the changes from https://github.com/cmmodtools/cgminer that were made to allow local mining to bitcoincore via RPC.
Having updated the bitcoincore config file from the testnet set-up, it seemed to be working fine for mainnet.
I think mining to a pool is easier though since someone else has already taken the hassle out of the set-up. But if like me you're up for a technical challenge from time to time, it can be done.
Since RPC is available on bitcoincore, it is capable of solo mining with the appropriate adjustments. I think what was removed many years ago was the ability to mine directly from CPU or GPU not from an external source on RPC.