Found the problem, updating for posterity's sake.
I was searching my computer for other mentions of that error. The function ACAPI_Element_Link mentioned that the error I got is caused (in that case) by not having an undoable session open. I had used the undoable session in a earlier version of my code, but left it out "temporarily" when I rewrote the function..... Apparently I corrected my other problem(s), just needed that undo session.