This web3 function could be useful:
https://web3js.readthedocs.io/en/v1.2.8/web3-eth.html#handlerevert
One issue for revert could also be that the account does not have enough ETH to cover gas. Integration of the web3.estimate_gas function could be useful.
https://info.etherscan.com/reason-for-failed-transaction/#:~:text=In%20the%20event%20of%20a,as%20defined%20in%20the%20contract.
This web3 function could be useful:
https://web3js.readthedocs.io/en/v1.2.8/web3-eth.html#handlerevert
One issue for revert could also be that the account does not have enough ETH to cover gas. Integration of the web3.estimate_gas function could be useful.
https://info.etherscan.com/reason-for-failed-transaction/#:~:text=In%20the%20event%20of%20a,as%20defined%20in%20the%20contract.