A pretty easy solution in the end for me.
Go in to the lotus notes designer and select the database or template icon and then do a
Tools ->Recompile All LotusScript
This warns that it could take a while but only takes a few seconds not hours or anything. Obviously when 5 new colleagues / users are baying for blood / sharpening knives etc, every second seems like an eternity in hell.
Refresh design.
Why is this error appearing? The code in a form or agent was saved before the lotusscript library was saved, and so it needs to be re-saved.
This can occur even if the parameters of functions etc have not changed.
This would be especially annoying if it happens in a scheduled agent, check the agent log and the notes.log on the server if an agent doesn't seem to be running so test test test....
Apparently this can also happen with (shared) fields.... (scary, another reason not to use them). It might be worth resaving all forms etc if you get it.
I got this error using Lotus Notes 7.02, so I think recompiling all Lotusscript etc might be an idea from now on. I have not seen this in previous versions.
Another reason to update designs at the end of the day not "just before you go off for a friday lunch session" which I never do of course.
This can also happen with changing event code from lotusscript to formula, and when changing design attributes (agent code type) using the keyboard instead of the mouse ?!?!
Save and reopen the design element if this is the case.