Вопрос закрыт. Нашел у себя ошибку.
Кому интересно, делается так:
$iBlockId = 10;
$sectionId = 53;
$filter = [
'IBLOCK_ID' => $iBlockId,
'ACTIVE' => 'Y',
'IBLOCK_SECTION_ID' => $sectionId
];
$select = [
'ID', 'IBLOCK_ID', 'countElements'
];
$runtime = [
'elements' => [
'data_type' =>"Bitrix\Iblock\ElementTable",
'reference' => [
'=this.IBLOCK_ID' => 'ref.IBLOCK_ID',
'=this.ID' => 'ref.IBLOCK_SECTION_ID',
'=this.ACTIVE' => 'ref.ACTIVE',
],
//'join_type' => "LEFT"
],
'countElements' => [
'data_type' => 'integer',
'expression' => ['count(%s)', 'elements.ID']
]
];
$res = Bitrix\Iblock\SectionTable::getList(
[
'filter' => $filter,
'select' => $select,
'runtime' => $runtime
]
);
while($section = $res->fetch())
{
\Bitrix\Main\Diag\Debug::dump($section, $section['ID']);
}