Deduction Theorem: Given $\Gamma \cup \{A\} \vdash B$, we can deduce $\Gamma \vdash A \to B$
HM Counter-Example (?):
Take $A$ to be $\forall f : \alpha \to \alpha, \forall x : \alpha, f(x) = f(f(f(x)))$
Take $B$ to be $\forall g : \beta \to \beta, \forall y : \beta, g(y) = g(g(g(y)))$
Clearly $\Gamma \cup \{A\} \vdash B$, but the resulting proposition is problematic:
$[\forall f : \alpha \to \alpha, \forall x : \alpha, f(x) = f(f(f(x)))] \to [\forall g : \beta \to \beta, \forall x : \beta, g(x) = g(g(g(x)))]$
If we then instantiate $\alpha$ to be the boolean type $\mathtt{Bool}$, we get that an easily-provable proposition $\forall f : \mathtt{Bool} \to \mathtt{Bool}, \forall x : \mathtt{Bool}, f(x) = f(f(f(x)))$ implies $B$, which is clearly false.
$\Rightarrow\!\Leftarrow$
Is this a legitimate issue with Hindley-Milner formulations like $\textbf{Q}_0$? Or did I do math wrong? If it is valid, what are the implications of this unintuitive result? I imagine it is quite limiting to have a deductive system without the Deduction Theorem. Is this phenomenon well-documented somewhere?