You can read the J. Phys. Chem. C 2012, 116, 23485−23493 in which the way of calculating the absolute electronegativity is given and also read the 2003 paper (J. Phys. Chem. B 2003, 107, 1798-1803) which is reference 47 of previous paper
Your calculation seems to be good but it turns out that there are different approaches for the calculation of the band edges potential according to the papers proposed by Hadi Jabbar Alagealy
For the moment, the calculation of the band edge potentials of g-C3N4 by the Ginley approach remains unreliable. This could be done either by DFT or experimentally using the electrochemical methods (Mott-Shocttky).