Why capacitor banks are not recommend with generator sets?

A generator is a highly inductive device with low resistance. Capacitors are, well, capacitive. when you have an inductor near a capacitor, you can get ringing.

This is known as ferroresonance. The capacitance and inductance form an LC tank circuit, which causes excessive overvoltages. Generators are typically high impedance grounded, which contributes to ferroresonance issues.