What is the true relationship between impossible figures and cohomology?

The drawing domain of most impossible figures is a circle or an annulus. The reason they're impossible is that there is no single "height function" that covers all of it, even though there is a "steepness function".

In other words, there exists a function that looks like it should be a derivative / gradient, but isn't. That's exactly what non-trivial cohomology is all about. This is impossible on a simply connected domain like the whole plane or a solid disc, but it is very much possible on a circle / annulus.