Instead of supplying maxiter as an argument to the energy function, treat it as an option. Just include one of the following lines before your energy call:

set maxiter 500 to apply to all methods, orset scf maxiter 500 to apply to just scf.

Might I ask for the coordinates of this troublesome molecule? Improving our SCF code is high on the developer to-do list, and we’d appreciate any examples of molecules we can use to test the SCF changes.