The problem you are experiencing is caused by not having a single root installation dir.
Wix# still assigns (as it always does) the INSTALLDIR to the first common parent
This will install the files as you would expect. However, your whole scenario creates an ambiguity about your installation directory. What is it? Is it SubDir1 or SubDir2? You will have difficulties of engaging any functionality that relies on the concept of a single root install directory (MSI fundamental paradigm). MSI InstallDir dialog will pick your first sub dir and treat it as the install dir and will completely prevent you from changing the second one. Wix# ManagedUI dialogs are under the same scrutiny too.
Everything would work just fine if you only have a root directory defined:
Wix# still assigns (as it always does) the INSTALLDIR to the first common parent
%ProgramFiles%
. However this in turns breaks the MSI Id assignment constrain for the well-known directories (e.g. Program Files). This can be easily avoided by you defining the dir id explicitly:new Project("MyProduct", new Dir(new Id("ProgramFiles64Folder"), "%ProgramFiles%", new Dir(@"SubDir1", new File(@"Files\test2.txt")), new Dir(@"SubDir2", new File(@"Files\test2.txt")) ...
Everything would work just fine if you only have a root directory defined:
new Project("MyProduct", new Dir("%ProgramFiles%\MyProduct", new Dir(@"SubDir1", new File(@"Files\test2.txt")), new Dir(@"SubDir2", new File(@"Files\test2.txt")) ...