How do I properly calculate an inverse element for curve25519 when implementing Sphinx password store protocol?
While point coordinates lie in the finite field over which the curve is defined, in this case $GF(p)$ with $p=2^{255}-19$, the scalars that you use lie in a field defined by the order of the generator, which is different from $p$.

Therefore when you invert using feInvert you invert with respect to the wrong prime.

You need to invert in $GF(n)$ with $n=2^{252} + 27742317777372353535851937790883648493$.

Unfortunately for you, X25519 never use arithmetic in $GF(n)$ and the only operation required by ed25519 in $GF(n)$ is the modulo reduction, not the inversion. 
Therefore there is no readily available code for that in the reference implementations, and you have to either look for some code that implemented it or build your own.