Let $G$ and $H$ be groups. The identity homomorphism $G\to G$ and the trivial homomorphism $H\to G$ give a homomorphism $G\ast H\to G$ by the universal property of the coproduct. Similarly, we obtain a homomorphism $G\ast H\to G$. Then the universal property of the product gives a homomorphism $G\ast H\to G\times H$. We can consider the kernel $K$ of this homomorphism. It turns out that $K$ is a free group ($K$ is freely generated by commutators $[g,h]$ for $g\in G\setminus\{1\}$ and $h\in H\setminus\{1\}$).
The construction of $K$ was very category-theoretic and only required the use of the universal properties of the product and coproduct. Similarly, the conclusion that $K$ is free is also a category-theoretic statement. Is there a proof that $K$ is free that is "category-theoretic" and avoids directly showing that the commutators $[g,h]$ for $g\in G\setminus\{1\}$ and $h\in H\setminus\{1\}$ freely generate $K$?
As people are mentioning in the comments, it is unlikely for such a proof to exist do to the reliance on a choice of generators in the categorical definition of a free group. Is there a (nonabelian) category similar to the category of groups in which this property fails?
The result is not "categorical". There are categories, even varieties of groups, where it fails.
Consider the variety of groups satisfying the laws $x^4=1$, $[x,y]^2=1$, and $[x,y,z]=1$. This is the variety of nilpotent groups of class $2$, exponent $4$, and all commutators of exponent $2$.
Let $G=\langle x\mid x^2=1\rangle$, $H=\langle y\mid y^2=1\rangle$. Then their free product in this variety is their $2$-nilpotent product, which consists of all elements of the form $x^ay^bz^c$, where $0\leq a,b,c<2$, and multiplication is given by $(x^ay^bz^c)(x^{\alpha}y^{\beta}z^{\gamma}) = x^{a+\alpha} y^{b+\beta} z^{c+\gamma+b\alpha}$, with exponents taken modulo $2$.
The kernel $K$ of the map $G\amalg H\to G\times H$ is generated by $z$, and so is cyclic of order $2$. However, the free group of rank $1$ in this variety is cyclic of order $4$, not $2$, so this kernel is not free.
For an example where what you get is not a subgroup of the corresponding free group, take the variety of all nilpotent groups of class $2$. If you take $G$ and $H$ each to be the relatively free group of rank $2$ (this is isomorphic to the group of $3\times 3$ upper triangular matrices with coefficients in $\mathbb{Z}$ and $1$s in the diagonal), then their free product is again their $2$-nil product (similar to the above, the elements are of the form $ghz$ with $g\in G$, $h\in H$, and $z\in[H,G]\cong H^{\rm ab}\otimes G^{\rm ab}$, with product $(ghz)(g’h’z’) = (gg’)(hh’)(zz’[h,g’])$). Here, the kernel of the map is isomorphic to $\mathbb{Z}^4$, but the free groups of rank greater than $1$ are not abelian.