This is VERY far from being true: consider the $3$-dimensional Heisenberg Lie algebra
$L$ with basis $a$, $b$, $c$ and the only nonzero bracket $[a,b]=c$ (so $c$ is central in $L$). Consider the linear function $\rho$ on $L$ such that $\rho(c)=1$ and $a,b\in \ker\rho$. Assume the base field $K$ has characteristic $p>2$ and consider the $p$-dimensional vector space $V$ over $K$ with basis $v_0,v_1,\ldots, v_{p-1}$. Set $v_{-1}=v_p=0$ and define a linear action of $L$ on $V$ by setting $a.v_i=iv_{i-1}$, $b.v_i=v_{i+1}$ and $c.v_i=v_i$ for all $i$. It is straightforward to check that this is a $p$-dimensional irreducible representation of $L$.
Identify $a,b,c$ with their images in $\mathfrak{gl}(V)$. Then $a^p=b^p=0$ an $c^p=c={\rm Id}_V$. Since $p>2$, applying Jacobson't formula for $p$-th powers we get $$(\lambda a+ \mu b+\nu c-\nu {\rm Id}_V)^p=\lambda^p a^p+\mu^p b+\nu^pc-\nu^p{\rm Id}_V=\nu^pc-\nu^p {\rm Id}_V=0$$ for all $\lambda,\mu,\nu\in K$. It remains to note that
$\rho(\lambda a+\mu b+\nu c)=\nu$.