You are using a Gantry template, which likely has pre-defined module positions.
In the Hydrogen template that you're using, the module position will be getting called like this:
<jdoc:include type="modules" name="custom-position"/>
Note there is no type value, therefore it'll use the default (inherited) style. This -- for some ...
The arguments for JHtmlString::truncate() are:
string $text The text to truncate.
integer $length The maximum length of the text.
boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true).
boolean $allowHtml Allow HTML tags in the output, and close any open tags (default: true).
Change the last argument to ...
As indicated by your iterated var_dump() outputs on your dev page, the HTML strings that are in $text do not contain the class value required in your first $xpath->query().
There are no generated errors, just a logical hiccup. The parent div that you expected was not included in the string -- so the foreach() is never entered.
This is one of your $text ...