It turns out that the exception was getting caused by the IF2 not finding a valid endpoint.
When I set up an OpcUa_Any device with an endpoint to the IF2 the exception disappeared.