One remark about:
the only way to fix it was to copy the .cch files in question from my dev machine to the live environment and it all started to work.
This sounds like a really bad idea. You should never copy CCH files from one environment to another.
The only valid thing to do with CCH files is delete them (i.e. clear the cache). Copying CCH files from one place to another can give unpredictable results.

Even if it appeared to have worked in this case it's just something you should never do.