I think there is an ideal (ie - on an empty stomach) and reality.
My gelding had grade 3 ulcers this summer. We did sucralfate 2x a day (AM and late night, so it was closer to 12 hr apart, but I gave it to him with some alfalfa cubes (soaked) and his very small bit of grain. I opted to do that because I didn’t want to do battle with the syringe and then not get stuff in him (plus I had to travel and asking my mom to dose was not feasible). Vet had said I could do it with food, though empty stomach was preferred.
I did do the ulcergard midday, when he came in from turnout, where he had been grazing…sometimes it was later in the day, but about halfway between the sucralfate doses. He got a full tube of that for 5 weeks.
He did scope clear after that regimen, so I think I can say (in my sample of 1) that giving the sucralfate with food and the UG after grazing did not have a negative impact.