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. (Edit: below I construct such groups with some additional requirement.)

Let $I$ be any infinite set of primes (all primes if you like). Consider $G=\prod_{p\in I}\mathbf{Z}/p\mathbf{Z}$. This is an abelian group, whose torsion subgroup is $\bigoplus_{p\in I}\mathbf{Z}/p\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_{p\in I}\mathbf{Z}/p\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_{p\in I}\mathbf{Z}/p\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.

Edit (1) Concerning your question with additional requirement:

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.

Edit (2). Here is now an example for the question with additional requirement.

Claim: there exists a (discrete) countable abelian group satisfying (1') and (2').

First, consider the subgroup $M$ of $\mathbf{Q}$ generated by all $1/p$ for $p$ ranging over all primes (note that $1/4\notin M$). Then $M/\mathbf{Z}$ is isomorphic to $\bigoplus_p\mathbf{Z}/p\mathbf{Z}$. We consider a copy of $M$ in $\prod_p \mathbf{Z}/p\mathbf{Z} / \bigoplus_p \mathbf{Z}/p\mathbf{Z}$ and consider its inverse image $N$ in $\prod_p \mathbf{Z}/p\mathbf{Z}$. So, if $T$ is the torsion subgroup in $N$, we have $T=\bigoplus_p \mathbf{Z}/p\mathbf{Z}$ and $N/T\simeq M$.

I claim that this is not split. Indeed, let $x$ be a nontorsion element in $P=\prod_p \mathbf{Z}/p\mathbf{Z}$. Nontorsion means that its support $I$ is infinite. Then $x\in pP$ if and only if $p\notin I$. This shows that $\bigcap_p pP=0$. Hence $P$ has no subgroup isomorphic to $M$ (since $\bigcap_p pM=\mathbf{Z}$).

We have proved (2'). For (1'), lift the copy of $\mathbf{Z}$ in $N$. The quotient $N/C$ by this cyclic subgroup $C$ lies in an extension with kernel $T$, and quotient $M/\mathbf{Z}$, which is also isomorphic to $T$. It follows that $N/C\simeq\bigoplus_p F_p$, where $F_p$ is an abelian group of order $p^2$ for each $p$.

isconnected, because the image of $R\times 0$ is dense. $\endgroup$