Got invalid parent id 1382 for host "XXXXX.xxxxx.local" (TemplateTree.php:63)

the second query shows that it is infact a host that tries to import itself, but you copied the wrong query into the post

just delete the one row:

DELETE FROM icinga_host_inheritance where parent_host_id=1382 and host_id=1382;

after that you should be able to click on the host in icinga director again.
you can choose to delete the host in icinga director, or keep the host.

If you want to keep it, you have to reassign a template, because every host needs a template.

and as always make a backup first!