Dear Rob, I've been faced with the same error to the point I almost completely deinstalled Elite Battle System in the hopes of fixing it.
The error lies within your pbRegisterPartner bit;
The wiki and examples state you can use pbRegisterPartner(:TRAINER,"Name",PartyNumber), but what you should...