Aluffi suggests (II.10.4) proving that every abelian group has exactly one structure of group object in the category $\mathbf{Ab}$, and asks about what would be a group object in $\mathbf{Grp}$ (II.10.5).
So, let's assume that $\circ : G \times G \rightarrow G, \iota : G \rightarrow G, e : 1 \rightarrow G$ are the corresponding elements of some group object over $G \in \mathbf{Ab}$ (if they exist, but the existence is easy), and all the diagram commutativity requirements hold for them. Also let's explicitly mention they are morphisms in $\mathbf{Ab}$ which implies they are abelian group homomorphisms.
Previous exercise that I worked out suggests proving that if $(G, \cdot)$ is a group and $\circ : G \times G \rightarrow G$ is a group homomorphism such that $(G, \circ)$ is also a group, then $\circ$ and $\cdot$ coincide. It feels natural to piggyback on it and just prove that $(G, \circ)$ has a group structure with the inverse being $\iota$ and identity being the element chosen by $e$ (which we'll also call $e$), and then the uniqueness immediately follows (and, moreover, it follows that the group object over $G$ is $G$ itself, in a sense).
So let's just check the group structure:
$g_1 \circ g_2$ as a group operation on $G$ is well-defined and "typechecks", since $G \times G$ is just the cartesian product (with the right group structure on top) in $\mathbf{Ab}$.
$\forall g : G. e \circ g = g = g \circ e$ — holds, since the left-identity diagram requires that $\circ (e, g) = g$, and similarly for the right-identity.
$\forall g : G. \exists g' : G. g'g = gg' = e$ — satisfied by taking $g' = \iota(g)$ and using the commutativity of the diagrams involving $\iota$.
Associativity holds similarly.
All good. $(G, \circ)$ has a group structure, so it coincides with $(G, \cdot)$, so we're done.
Now let's get to $\mathbf{Grp}$. Basically the same argument as above should also hold, since I don't think I've used any abelianness, so the group object in $\mathbf{Grp}$ over $G$ coincides with $G$ itself. But I know that group objects in $\mathbf{Grp}$ are abelian groups too, so where am I mistaken?
I noticed this question has been asked a few times here, but I'm rather curious about any holes in my argument than just getting the proof done.