Problem with EXEC MyLinkedServer...sp_executesql within transaction
The error message refers to the OLE DB provider defined for the linked server. Hence the SQL code has no error. 

The problem is the linked server is not properly defined. You should test the connection with the linked server and you will see the full error.

To fix it: recreate the Linked server setting an OLE DB provider supported in your Sql Server version. For example: 'SQLNCLI' or 'SQLNCLI11'.

To recreate a linked server:


Right click -> Script Linked Server as -> Create To -> New query editor window.
Change the OLE DB provider and the correct password (it will be scripted as @rmtpassword='########').
Test the connection with the linked server.
Try to execute again:

EXEC MyLinkedServer...sp_executesql @sql