Reading files in the folder where an MSIX package is deployed needs to be done in a way that may not alter the files. As such, we found a way to make the code work, by replacing
catalog.Catalogs.Add(new DirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory));
by
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ??AppDomain.CurrentDomain.BaseDirectory;
foreach (string file in Directory.GetFiles(path, "*.dll"))
{
catalog.Catalogs.Add(new AssemblyCatalog(Assembly.LoadFrom(file)));
}