Let $X$ be a locally convex topological vector space and let $X^*$ denote its dual. Let $T \subset X^*$ be a Hamel basis of $X^*$. Consider the canonical map $$ \Phi\colon X \to \mathbb{R}^T, \qquad \Phi(x) = (x^*(x))_{x^* \in T}, $$ where $\mathbb{R}^T$ is endowed with the product topology. If we equip $X$ with the weak topology $\sigma(X,X^*)$, then $\Phi$ is a topological embedding of $X$ onto its image, and $\Phi(X)$ is dense in $\mathbb{R}^T$.
Let $f\colon X \to \mathbb{R}$ be a bounded function which is continuous with respect to the weak topology. Since $\Phi$ is an embedding, $f$ corresponds to a bounded continuous function $$ \tilde f\colon \Phi(X) \to \mathbb{R}. $$
Main question: Can every bounded weakly continuous function $f$ on $X$ be written as $$ f = g \circ \Phi $$ for some bounded continuous function $g \in C_b(\mathbb{R}^T)$?
Equivalently, does every bounded continuous function on the subspace $\Phi(X)$ extend to a bounded continuous function on the whole product $\mathbb{R}^T$?
Motivation / context
Trivially, every weakly continuous $f$ corresponds to some $\tilde f \in C_b(\Phi(X))$. The question is whether $\tilde f$ admits an extension to a function in $C_b(\mathbb{R}^T)$.
One may suspect the statement is false in general. For example, in product spaces $\mathbb{R}^T$ with uncountable $T$, continuous functions on dense subsets may fail to extend to the whole product (e.g., functions depending on finitely many nonzero coordinates). This provides a heuristic idea for constructing a counterexample in an infinite-dimensional Banach or Hilbert space.
In particular, one may ask about the Hilbert space $X = \ell^2$ with the weak topology: does a weakly continuous bounded function on $\ell^2$ always admit such a representation?
Thank you for any pointers, references, or counterexamples.