The inability of the Gattermann–Koch reaction to add an aldehyde group to phenols is not necessarily due to the electron density on the $\ce{O}$ atom. It rather seems to have different origins.
The Gattermann–Koch reaction is generally performed with $\ce{CuCl}$ as a carrier and $\ce{AlCL3}$ as the catalyst as follows:
$$
\ce{CO + HCl ->[CuCl] [HCOCl]}\\
\ce{C6H6 + [HCOCl] ->[AlCl3] C6H5CHO + HCl}\\
$$
But when the same reaction is done for Phenols and Phenolic Ethers, no formylation takes place. This is primarily attributed to the insolubility of $\ce{CuCl}$ in the reaction mixture[1]. It is also expected that the reaction will be successful at a higher pressure where $\ce{CuCl}$ is not necessary.[2]
For such conditions, Gattermann suggests a different reaction that might be used to formylate the phenols at normal pressure. The reaction is as described below:
For the above reaction,
Aluminium Chloride must be used as a catalyst with certain phenols and phenolic ethers; with others, zinc chloride may replace aluminium chloride.
References
(1) Gattermann, L. Zur Synthese Aromatischer Aldehyde. Ber. Dtsch. Chem. Ges. 1898, 31 (1), 1149–1152. https://doi.org/10.1002/cber.189803101210.
(2) Crounse, N. N. The Gattermann Koch Reaction. In Organic Reactions, Volume 5; Adams, R., Ed.; John Wiley & Sons, INC: London, 1949; p 290.
(3) Truce, W. E. TheGattermann Synthesis of Aldehydes. Organic Reactions. Wiley March 15, 2011, pp 37–72. https://doi.org/10.1002/0471264180.or009.02.
(4) Adams, R.; Montgomery, E. Simplification of the Gattermann Synthesis of Aromatic Aldehydes. Ii. J. Am. Chem. Soc. 1924, 46 (6), 1518–1521. https://doi.org/10.1021/ja01671a027.