How to deal with optimal power flow problem in MATLAB?
Infeasibility in OPF is quite common, specially if the demand is high. If you are confident that your formulation is correct, you can remove the generator output constraints and use a small value for total demand (and each nodal demand as well). For lightly-loaded system (small demand), your nonlinear network equations are "almost linear" and they should not impose any problems if they are correct.

However, in your case there may be other issues, as you don't seem to be confident about your script correctness.

A good way to investigate what is the cause of infeasibility is relaxing all of your constraints with penalties and "slack" variables. That is, you add variables to each equality/inequality and associate a high cost coefficient to them in the objective function. Now, your problem is always feasible, even if the optimal solution does not actually satisfy your constraints. However, the optimal solution will contain information regarding which constraints could not be met, as the corresponding "slack" variable will be nonzero.