As pointed out by @Open Ball, we can relax some requirement for the orthogonal decomposition.
Indeed, if $W$ is a subspace of an inner product space $V$ and there exists an orthogonal projection $P$ from $V$ onto $W$, then the mapping
$$ v \mapsto (Pv, v - Pv)$$
provides an isometry between $V$ and $W \oplus W^{\perp}$. A sufficient condition for the existence of such $P$ is that $W$ is complete w.r.t. the topology induced by the inner product.
A proof for this general claim is provided below, though this is easy to prove when $W$ is finite-dimensional. For instance, if $\dim W = n \in \Bbb{N}$ and $\{w_1, \cdots, w_n\}$ is an orthonormal basis of $W$, then
$$ Pv = \sum_{k=1}^{n} \langle w_k, v \rangle w_k $$
is an orthogonal projection onto $W$. Now we can apply this fact to $V = X$ and $W = \Bbb{C}z$ with $z(t) = t^2$.
Lemma. Let $(V, \langle \cdot, \cdot \rangle)$ be a (real or complex) inner product space equipped with the topology induced by the inner product. If $W$ is a complete subspace of $V$, then there exists an orthogonal projection $P$ from $V$ onto $W$.
(In case of complex inner product, we adopt the convention that $\langle \cdot, \cdot \rangle$ is conjugate-linear in the first argument and linear in the second argument.)
Proof. Define the orthogonal projection $P : V \to W$ such that $Pv$ is the unique element in $W$ that minimizes the distance to $v$, or succinctly,
$$ Pv := \underset{w \in W}{\arg\min} \| v - w \|. $$
Here, $\| \cdot \| := |\langle \cdot, \cdot\rangle|^{1/2}$ is the norm induced by the inner product. It is a routine job to prove that $P$ is well-defined:
Existence. Let $\ell = \inf\{ \| v - w \| : w \in W \}$. Then for any $w, w' \in W$, the parallelogram law tells us that
\begin{align*}
\|w - w'\|^2
&= 2\|w - v\|^2 + 2\|w' - v\|^2 - 4 \left\| \frac{w + w'}{2} - v \right\|^2 \\
&\leq 2\|w - v\|^2 + 2\|w' - v\|^2 - 4\ell^2. \tag{*}
\end{align*}
Now for each $n$, we can find an element $w_n \in W$ such that $\|v - w_n\|^2 < \ell^2 + 2^{-n}$. Then by $\text{(*)}$,
$$ \|w_n - w_{n+1}\|^2 \leq 2(\ell^2 + 2^{-n}) + 2(\ell^2 + 2^{-n-1}) - 4\ell^2 = 3\cdot 2^{-n}. $$
Thus $(w_n)$ is a Cauchy sequence. Since $W$ is complete, $(w_n)$ converges to some $w \in W$. This $w$ satisfies $\|v - w\| = \ell$ and hence $w$ is a distance-minimizer.
Uniqueness. If $w, w' \in W$ minimizes the distance to $v$, then $\ell = \|v - w\| = \|v - w'\|$. By $\text{(*)}$,
$$ \|w - w'\|^2 \leq 2\ell^2 + 2\ell^2 - 4\ell^2 = 0. $$
Therefore $w = w'$.
The mapping $P : V \to W$ is now well-defined and surjective. It remains to prove that $P$ is indeed an orthogonal projection to $W$. Again, establishing this claim is routine:
Orthogonality. The proof follows from the usual variational principle. Let $v \in V$. Then for any $w \in W$, the quadratic function
$$t \mapsto \| v - Pv - tw \|^2 = \|v - Pv\|^2 - 2t\operatorname{Re}\langle v - Pv, w \rangle + t^2\|w\|^2 $$
achieves the global minimum at $t = 0$. This implies that $\operatorname{Re}\langle v - Pv, w \rangle = 0$. Replacing $w$ by $iw$ in the complex inner product case, this implies that $\langle v - Pv, w \rangle = 0$. Since this is true for all $w \in W$, we have $v - Pv \in W^{\perp}$.
Conversely, assume that $w \in W$ satisfies $v - w \in W^{\perp}$. Then by the Pythagoras theorem
$$ \ell^2 = \| v - Pv \|^2 = \| v - w \|^2 + \| w - Pv \|^2 \geq \ell^2 + \| w - Pv \|^2. $$
This shows that $w = Pv$. Thus $Pv$ is specified as the unique element $w \in W$ such that $v - w \in W^{\perp}$.
Linearity. If $u, v \in V$ and $\alpha, \beta$ are scalars, then for any $w \in W$
$$ \langle (\alpha u + \beta v) - (\alpha Pu + \beta Pv), w \rangle = \bar{\alpha} \langle u - Pu, w \rangle + \bar{\beta} \langle v - Pv, w \rangle = 0 $$
and hence $\alpha Pu + \beta Pv = P(\alpha u + \beta v)$.