Just found out that I'm not able to set complex fomulas because cell.set_formula produces unpredictable output
INDIRECT(ADDRESS(ROW();COLUMN()-1))/INDIRECT(ADDRESS(ROW();2)) becomes INDIRECT(ADDRESS(ROW()|COLUMN()-1))/INDIRECT(ADDRESS(ROW()|2))
All semicolons are replaced with "|" and formula does not work.
I can not see any character replacement logic in formula object. So I guess it is happening somewhere while saving file.