Solution
This behaviour is due to a known issue using the OPC UA toolkit to communicate with a third-party server, to solve this issue please update the OPC UA Toolkit to the 2018 version available
here.
This error can also occur if the string parameters in your code are incorrect. Resolve this by ensuring your code's string parameters are free of illegal characters, such as quotes.