Thanks Lawrence, I've tried this... I've attached some code for the shallow water equations with hand coded pullbacks in the mass term (other terms don't need them). If I set do_apply_function_pullbacks=False in tsfc/ufl_utils.py then running the code (sometimes) gives the error below. When it doesn't error, the solver just fails to converge. I can't figure out why the behaviour changes.
Any suggestions most welcome! Thanks!