There is something not correct in your configuration file.
You mention the use of an upgraded controller board from an MKS GEN L to a MKS GEN L v2.1. This change of hardware is not effectively present in your configuration.h file, ik currently States the use of the old board:
// Choose the name from boards.h that matches your setup
I am not the best with firmware modifications or anything like that, but you could try running your printer through OctoPrint and do the bed leveling through that and maybe that might fix the problem that you are facing.