First, you to have to check why the parameter is not working
If you check addCategoriesFilter function definition, then you will find it support a parameter which is an array. the parameter is a one-dimensional array which supports index as condition Type and value as filter value.Like
$categoriesFilter =
[
'in' => [10,15],
'nin' => [12,18]
]
So,you have to change
addCategoriesFilter('category_id', array(
array('nin' => $currentCategoryId),
))
to
addCategoriesFilter(array('nin' => $currentCategoryId))
public function addCategoriesFilter(array $categoriesFilter)
{
foreach ($categoriesFilter as $conditionType => $values) {
$categorySelect = $this->getConnection()->select()->from(
['cat' => $this->getTable('catalog_category_product')],
'cat.product_id'
)->where($this->getConnection()->prepareSqlCondition('cat.category_id', ['in' => $values]));
$selectCondition = [
$this->mapConditionType($conditionType) => $categorySelect
];
$this->getSelect()->where($this->getConnection()->prepareSqlCondition('e.entity_id', $selectCondition));
}
return $this;
}