Here's, for any positive integer $k$, a second countable, compact group, of dimension $k$, whose zero connected component is not a topological direct factor.
Let $I$ be any infinite set of primes (all primes if you like). Consider $G=\prod_{i\in I}\mathbf{Z}/p_i\mathbf{Z}$. This is an abelian group, whose torsion subgroup is $\bigoplus_{i\in I}\mathbf{Z}/p_i\mathbf{Z}$, and the quotient is a torsion-free divisible abelian group, hence isomorphic to some $\mathbf{Q}$-vector space of uncountable dimension. Choose any integer $k>0$, and pick a subgroup of the latter quotient, isomorphic to $\mathbf{Q}^k$, and let $H$ be its inverse image in $G$. (With some little effort, one can construct explicitly such $H$.)
So the torsion subgroup in $H$ is $\bigoplus_{i\in I}\mathbf{Z}/p_i\mathbf{Z}$, and the quotient by the torsion is isomorphic to $\mathbf{Q}^k$. This is not splittable as direct product of torsion and torsion-free, since $H$ is residually finite and $\mathbf{Q}$ is not.
Let $K$ be the Pontryagin dual of the discrete group $H$, let $S$ be the Pontryagin dual of $\mathbf{Q}$ (this is a connected, 1-dimensional, torsion-free compact group). Then $K$ admits $S^k$ as closed subgroup (equal to its 0 connected component), and the quotient is topologically isomorphic to the Pontryagin dual of $\bigoplus_{i\in I}\mathbf{Z}/p_i\mathbf{Z}$, namely $G$ itself (viewed now as topological group, profinite). This is not part of a splitting as topological direct product, because it was not the case at the dual level.
Added: concerning your additional question:
You want a compact abelian group such that (1) it has a closed profinite subgroup, isomorphic to a product of finite groups, such that quotient is a (finite-dimensional) torus, and (2) then $K$ is not direct product of its zero component $K^\circ$ with any closed subgroup.
By Pontryagin duality, this is equivalent to finding a (discrete) abelian group $A$ with the properties: (1') it has a subgroup that is free of finite rank, such that the quotient is a direct sum of finite groups. (2') The torsion subgroup in $A$ is not a direct factor.
The groups $H$ above do not answer this, because the quotient of such $H$ by any nonzero finitely generated subgroup contains a Prüfer group at some prime.
The property "be a direct sum of finite abelian groups" (or product, at a dual level) is a bit unstable. I see from the examples you have in mind that you mainly think of a direct sum $\prod_pF_p$ with $F_p$ finite $p$-group; the latter smaller class is better-behaved as it passes to quotients (i.e., at the compact side, the corresponding class passes to closed subgroups).