Use another writer than xdmf, as suggested in: How to make Von Mises Stress look better - #10 by dokken
Please search for the error message on the forum before posting
https://fenicsproject.discourse.group/search?context=topic&context_id=17351&q=RuntimeError%3A%20Degree%20of%20output%20Function%20must%20be%20same%20as%20mesh%20degree.%20Maybe%20the%20Function%20needs%20to%20be%20interpolated%3F%20order%3Alatest&skip_context=true
as there are many posts on the same topic.