Using that $(A,B)\mapsto\operatorname{trace}(A^\top B)$ is a scalar product (or as suggested by @dsh that $(A,B)\mapsto\operatorname{trace}(A B)$ is a non-degenerate bilinear form) we can prove coordinate free that
$$ \mathbf{span} \left\{ AB-BA : A,B\in\mathbb{R}^{d\times d} \right\} = \ker \operatorname{trace}.$$
Let $X\in\mathbb{R}^{d\times d}$ be orthogonal to all matrix commutators $AB-BA$ and $M\in\mathbb{R}^{d\times d}$.
Then, for all $N\in\mathbb{R}^{d\times d}$,
\begin{align*}
\langle XM-MX, N\rangle &= \langle XM, N\rangle - \langle MX, N\rangle \\
&= \operatorname{trace}(N^\top XM) - \operatorname{trace}(N^\top MX) \\
&= \operatorname{trace}(M N^\top X) - \operatorname{trace}(N^\top MX) \\
&= \langle NM^\top - M^\top N,X\rangle \\
&= 0.
\end{align*}
This proves $XM=MX$. Since $X$ commutes with all matrices it must be a scalar multiple of the identity (see here for a coordinate free proof).
In other words,
\begin{align}
\left\{ AB-BA : A,B\in\mathbb{R}^{d\times d} \right\}^\perp = \mathbb{R} I.
\end{align}
This extends to the generated subspace, which shows that it is a hyperplan. Being contained in the kernel of the trace it must be equal to it.
Disclaimer: this answer is incomplete since it remains to prove that the set of matrix commutators is a linear subspace, and in particular closed under addition. As a remark, this cannot be proved directly with some algebraic manipulations that only use the definition of the commutator: indeed, this does not necessarily hold for commutator rings (combine for instance Theorem 15 and Proposition 19 from Commutator rings, Mesyan, 2008).