In firmware configuration.h
But question was more if the direction was configured correctly. You said you can move z up/down manually so that works in general. Generated gcodes normally only move up (my definition) means that if it then goes down that the direction is just configured the wrong way, also I do not know why homing and z probing then would work as you expect except if you also added errors to cover the direction error. That is why I told you how increasing z should move so you can compare.