Let $M$ be a differential manifold and $\mathcal H^k$ the presheaf of real vector spaces associating to the open subset $U\subset M$ the $k$-th de Rham cohomology vector space: $\mathcal H^k(U)=H^k_{DR}(U)$. Is this presheaf a sheaf?
Of course not! Indeed, given any non-zero cohomology class $0\neq[\omega]\in \mathcal H^k(U)$ represented by the closed $k$-form $\omega\in \Omega^k_M(U)$ there exists (by Poincaré's Lemma) a covering $(U_i)_{i\in I}$ of $U$ by open subsets $U_i\subset U$ such that $[\omega]\vert U_i=[\omega\vert U_i]=0\in \mathcal H^k(U_i)$, and thus the first axiom for a presheaf to be a sheaf is violated.
But what about the second axiom?
My question:
Suppose we are given a differential manifold M, a covering $(U_\lambda)_{\lambda \in \Lambda}$of $M$ by open subsets $U_\lambda \subset M$, closed differential $k-$forms $\omega_\lambda \in \Omega^k_M(U_\lambda)$ satisfying $[\omega_\lambda]\vert U_\lambda \cap U_\mu=[\omega_\mu]\vert U_\lambda \cap U_\mu\in \mathcal H^k(U_\lambda\cap U\mu)$ for all $\lambda,\mu \in \Lambda$.
Does there then exist a closed differential form $\omega\in \Omega^k(M)$ such that we have for the restrictions in cohomology: $[\omega]\vert U_\lambda=[\omega _\lambda]\in \mathcal H^k(U_\lambda)$ for all $\lambda\in \Lambda$ ?
Remark
This is an extremely naïve question which, to my shame, I cannot solve.
I have extensively browsed the literature and consulted some of my friends, all brilliant geometers (albeit not differential topologists), but they didn't know the answer offhand.
For what it's worth, I would guess (but not conjecture!) that such glueing is impossible.