I finally solved the problem. Even though I hadn’t used the woocommerce-payments plugin for years and had deleted it, there were still files in my wp-content folder. After manually deleting these all is back to normal.
Thanks. The only payments plugin I have is Woocommerce Paypal Payments plug in which is currently deactivated. I am not using a plugin solely called Woocommerce Payments. All plugins are deactivated.