300/CRM integration error

Sage 2019 PU4 with CRM 2020 R1. Correct integration installed. Sage side of the integration is set up and Sage can communicate with CRM.

In CRM, the CRM user has been given the same password as the CRM user in Sage. The user name and password are capitalised. Sage300Webapi application does not have Windows Authentication enabled. I can log into Sage as the CRM user and all I can see is the Sage CRM module. I can log into CRM as the CRM user with the capitalised password.

I set the integration up in CRM. The database ID is correct. The Sage 300 company name I copied and pasted from the company profile. The server name is the URL used to log into web screens (which I can successfully do), so it is http://<servername>/Sage300. The company email is the email address from the company profile in Sage 300. I have not set this to be the default company as I want the user to always have to choose a Sage company when promoting. The user level security, I have set ADMIN and a capitalised password for each user and ticked all the boxes. There is nothing defined under database level security. I click Synchronise Tables and choose the company. All boxes are ticked. I click Synchronise and eventually I get the error:

An error has occurred in a CRM .net customisation. Please contact your vendor to resolve.

I have .NET logging up full. I've tried everything I can find in the knowledge base and I still get the error.

Anyone any ideas?