The error message isn’t very helpful, but as you have DateTime objects kicking about these are known for breaking changes OH2->OH3. Essentially there is no DateTime anymore, use alternative.
Also beware that OH3 has some persistence by default, and it may not be the one you expected when allowing persistence extensions in rules to default requested service…