Error with custom method call from context menu

Start here, but read the whole topic:

TL/DR: Install my free Simulation Aids module to get reliable jython behavior with components no matter what java methods delivered them.