I was trying to figure out why my viz was no longer working since my refactor towards Docker Compose v2. I started to revert some changes and found that adding a dummy version top-element fixed my viz problem.
The "version" element is no longer mandatory https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-top-level-element and should not be essential to creating a viz.