Direct factor is not finite-join-closed

Statement
A join of finitely many direct factors of a group need not be a direct factor. More specifically, it is possible to have a group $$G$$ and two subgroups $$H, K$$ of $$G$$ such that both $$H$$ and $$K$$ are direct factors and the join $$HK$$ is not a direct factor.

Related facts

 * Transitive normality is not finite-join-closed
 * Central factor is not finite-join-closed

An abelian group example
Suppose $$C_n$$ denotes the cyclic group of order $$n$$. Define:

$$G = C_4 \times C_2$$.

Consider the following subgroups:

$$H = 0 \times C_2, \qquad K = \{ (2,1), (0,0) \}, L = C_4 \times 0$$.

Then, both $$H$$ and $$K$$ are direct factors of $$G$$, with a common direct factor complement $$L$$. On the other hand, we have:

$$HK = \{ (2,1), (2,0), (0,1), (0,0) \}$$.

This is not a direct factor of $$G$$, because if a complement exists, it must have order two, but all elements of $$G$$ outside $$HK$$ have order four.