Usually that error means that you don’t that the correct abi or contract address or network
RPC URL: http://127.0.0.1:7545
Chain ID: 1337
on metamask, How do I go about changing the abi?
In ganache, did you deploy that smart contract? Did you copy the address of the deployed smart contract in your code?
Is MetaMask connected to ganache when you execute that smart contract function? Is ganache running?