For some reason, the scripts that I had run, had created some tables in the results schema, with missing mode_id field and wrong table constraints. After running:
ALTER TABLE ohdsi.cohort_inclusion_result ADD mode_id int NOT NULL DEFAULT 0;
ALTER TABLE ohdsi.cohort_inclusion_stats ADD mode_id int NOT NULL DEFAULT** 0;
ALTER TABLE ohdsi.cohort_summary_stats ADD mode_id int NOT NULL DEFAULT 0;
The following post helped me a lot in the debugging process:
and removing pkey constraint from tables cohort_inclusion_result, cohort_inclusion_stats, cohort_inclusion and cohort_summary_stats everything seems to be working fine.