Documentation for FlexibleContexts seems quite wrong
Check out https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/flexible_contexts.html?highlight=flexiblecontexts#extension-FlexibleContexts. It describes -XFlexibleContexts
as dealing with superclass contexts, only. This should be fixed.