Direct factor is not upper join-closed

Statement
We can have a subgroup $$H$$ of a group $$G$$, and intermediate subgroups $$K_1$$ and $$K_2$$ such that $$H$$ is a direct factor of $$K_1$$ as well as a direct factor of $$K_2$$, but $$H$$ is not a direct factor of the join of subgroups $$\langle K_1, K_2$$.

Example of the dihedral group
Consider the dihedral group of order eight:

$$G := \langle a,x \mid a^4 = x^2 = e, xax = a^{-1} \rangle$$.

Let:

$$H = \langle a^2 \rangle, K_1 = \langle a^2, x \rangle, K_2 = \langle a^2, ax \rangle$$.

Then:


 * $$H$$ is a direct factor of $$K_1$$, which is a Klein four-group and is the internal direct product of $$H$$ and $$\langle x \rangle$$.
 * $$H$$ is a direct factor of $$K_2$$, which is a Klein four-group and is the internal direct product of $$H$$ and $$\langle ax \rangle$$.
 * $$H$$ is not a direct factor of $$\langle K_1, K_2 \rangle = G$$. In fact, since $$H$$ is the center of $$G$$, it intersects every nontrivial normal subgroup nontrivially (nilpotent implies center is normality-large).