See discussion @ https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/545864/1/src/Wt2Html/DOMPostProcessor.php#720
If you look at the code for src/Config/Api/PageConfig.php for the case where $opts['pageContent'] is passed in, it falls back to 'en' and 'ltr' page properties. However, it should actually be initializing these properties based on the title much like how we do it for the API when we post content against a title and where page properties come from the title object.
Check whether the code paths from parse.php -> MockPageConfig/MWPageConfig also need similar fixes.
Also, note that in Parsoid/PHP, PageConfig::getPageLanguage() and PageConfig::getPageLanguageDir() don't return null values => all conditionals in the codebase around these return values should be eliminated since we are going to be initializing these values correct always after the fixes above.