  In this paper we prove that the $k$-th order metric-affine Lovelock
Lagrangian is not a total derivative in the critical dimension $n=2k$ in the
presence of non-trivial non-metricity. We use a bottom-up approach, starting
with the study of the simplest cases, Einstein-Palatini in two dimensions and
Gauss-Bonnet-Palatini in four dimensions, and focus then on the critical
Lovelock Lagrangian of arbitrary order. The two-dimensional Einstein-Palatini
case is solved completely and the most general solution is provided. For the
Gauss-Bonnet case, we first give a particular configuration that violates at
least one of the equations of motion and then show explicitly that the theory
is not a pure boundary term. Finally, we make a similar analysis for the $k$-th
order critical Lovelock Lagrangian, proving that the equation of the coframe is
identically satisfied, while the one of the connection only holds for some
configurations. In addition to this, we provide some families of non-trivial
solutions.
