Somehow, some of the domains lost their connection to a client account.
If you have similar problems, try this:
select id, name, cl_id from domains where cl_id=0;
If you have any results, associate those domains with your admin account (here: ID 1)
update domains set cl_id=1 where cl_id=0...