You might have added the custom network in the MetaMask wallet. In the MetaMask wallet go to **Settings > Advanced** and clear the data. Do this whenever you have redeployed the contract or restarted the blockchain node. This will stop the error.