I suppose there is a copy-paste fail
./api/classes/Chost.php
In a function massRemove:
if (isset($data['templateids_clear'])) {
$options = array(
'templateids' => $hostids,
'templateids_clear' => zbx_toArray($data['templateids_clear'])
Note:
'templateids' => $hostids,
but probably should be:
'hostids' => $hostids,
Also please add an option 'templateids_clear' to the function description (PHP doc)