Colocation of the two tables table1 and table2 is a condition on the distribution of the outer join between these two tables. Therefore, when you try to run an outer join between table1 and table2, you are seeing that error.
To overcome that error, the tables should be colocated. This basically means that shards of the distributed table should match one to one, i.e. each shard of table1 should overlap with one and only one shard from table2. Different partition (distribution) column types between table1 and table2 is the most common reason of resulting in non-colocated tables.
So, you should make sure that table1 and table2 have the same partition column type.