Unable to correctly programmatically declare server-based termbases

I'm having a problem programmatically adding server-based termbases to a project.

I have the following code (C#):

    TermbaseConfiguration termbaseConfig = project.GetTermbaseConfiguration();
    termbaseConfig.TermbaseServerUri = "http://our.server.url/groupshare/";
    termbaseConfig.Termbases.AddRange(termbases.Select(t => new ServerTermbase(t.Name, null, true)));

When I open this project in Trados the termbase is greyed-out, the "Enabled" checkbox is unchecked (even though the .sdlproj file contains <Enabled>true</Enabled>) and there is a red circle with a cross next to the termbase name (instead of a green circle with a tick).

So I compared the programmatically-generated .sdlproj file with one created by Trados and referencing the same TM and termbase.

Trados-generated project file:

    <Termbases>
        <Name>MY_TERMBASE_NAME</Name>
        <SettingsXml>&lt;?xml version="1.0" encoding="utf-16"?&gt;
    &lt;TermbaseSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;Path&gt;sdltb.http://our.server.url/groupshare/\%\MY_TERMBASE_NAME&lt;/Path&gt;
      &lt;IsOpen&gt;false&lt;/IsOpen&gt;
      &lt;Filter&gt;0&lt;/Filter&gt;
      &lt;FilterHighlight&gt;false&lt;/FilterHighlight&gt;
      &lt;Layout&gt;0&lt;/Layout&gt;
      &lt;Local&gt;false&lt;/Local&gt;
      &lt;IsCustom&gt;false&lt;/IsCustom&gt;
    &lt;/TermbaseSettings&gt;</SettingsXml>
        <Enabled>true</Enabled>
    </Termbases>

And here is the programmatically-generated equivalent:

    <Termbases>
        <Name>MY_TERMBASE_NAME</Name>
        <SettingsXml>&lt;?xml version="1.0" encoding="utf-16"?&gt;
    &lt;TermbaseSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;Path&gt;our.server.url\%\MY_TERMBASE_NAME&lt;/Path&gt;
      &lt;IsOpen&gt;false&lt;/IsOpen&gt;
      &lt;Filter&gt;0&lt;/Filter&gt;
      &lt;FilterHighlight&gt;false&lt;/FilterHighlight&gt;
      &lt;Layout&gt;0&lt;/Layout&gt;
      &lt;Local&gt;false&lt;/Local&gt;
      &lt;IsCustom&gt;false&lt;/IsCustom&gt;
    &lt;/TermbaseSettings&gt;</SettingsXml>
        <Enabled>true</Enabled>
    </Termbases>

In case it's not obvious, the difference is the "Path" node in the escaped XML...

Trados-generated:

    &lt;Path&gt;sdltb.http://our.server.url/groupshare/\%\MY_TERMBASE_NAME&lt;/Path&gt;

programmatically-generated:

    &lt;Path&gt;our.server.url\%\MY_TERMBASE_NAME&lt;/Path&gt;

The Trados-generated code has the correct URL.

Note that the .sdlproj file also contains the following nodes, which are correct in both the Trados-generated and programmatically-generated versions:

    <TermbaseServer>
        <ServerConnectionUri>http://our.server.url/groupshare/</ServerConnectionUri>
    </TermbaseServer>

I've found that even if I force the TermbaseServerUri property with

    termbaseConfig.TermbaseServerUri = "sdltb.http://our.server.url/groupshare/";

the output is still the same. It uses the correct value for the <ServerConnectionUri> node but not inside the <SettingsXml> nodes.

Can anyone explain why my code results in the termbase being declared differently in the project file? And does this explain why the termbase is greyed-out and not enabled when the project is viewed in Trados?