If the error is happening from the smart contract then only this require
statement could cause that error.
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
Try checking the allowance of the addresses using the allowance
function. This should not be equal to 0, to complete the approve
function.