Once you reach that point tinker a little, not a lot. When you feel resistance take a break, never force yourself. Don't force yourself to write code you don't enjoy writing, find ways around it, at least initially. You need to avoid reinforcing the association between code and pain until you have a buffer of good experiences in your new domain.
It might be (probably will be) necessary to find a new career path in the meantime.
Good luck.