The error was caused by a return statement in the trigger code. Once I removed this, the error ceased and everything worked as expected.
Thanks to points to possible causes from a Michael Taylor from Microsoft Q&A