I would probably not pet her when she's out grazing. try to sort of separate time when she's on HER time, and time when she's on YOUR time.
when you have her on a lead rope, it's YOUR time, and so that means not hand grazing. I know, many people do this , but most do it because it's the only way their horse will get any grazing , so I can understnad that. And, they will have a respectful horse to begin with, too, or at least they should.
I try to keep it so that when my horse is 'online', it's not his choice to do what he wants, and I test that by asking him to do things, a lot. like, step back, go over there and stand over there, no, don't come back. move your hind end over so I can get past you. step back one step so I can reach the cinch , stop calling to your herd mates . . . . etc.
all of this entails being aware of when your horse is thinking on something OTHER THAN YOU, and when that happens, as soon as it happens, you interrupt that outward thinking and do just enough to have him let go of that thought and come back to thinking on you.
when you are ready to release your horse after a ride or a groundwork session, you take them through the gate, ask them to turn around and face you, you remove the halter, and YOU turn away from them. YOU leave them, not the other way around. don't stand there while they turn their backs and minds on you and leave you. this is bad practice for them. It is you who releases them and walks away first. this is a small thing, but it's important.
when you have given them permission to eat, leave them alone. if you must interrupt, do it fully. make them mentally 'online' again, until you turn away from them and walk off, telling them that they are back on their own time again.
don't mix the two by grooming them if they are off work.
at least for a bit. once a horse is ok with your authority, you may find that field grooming/petting will be ok. however, you have to be just that much more careful because the hrose's mind is not WITH you, it's with his food, so he might be more likely to forget and barge into your space or step on you, etc.