The only way to ensure a flag doesn’t move when draped on a casket is to put a casket band on it or underneath it and then tuck the flag into it. Any other time, you risk the flag moving one way or another and that’s not necessarily a bad thing, you just have to be aware of the possibility. It’s appropriate to break your position and grab the flag if it’s sliding off, especially when it’s placed on the mockup (the lowering device placed over the grave). Some areas don’t use a mockup (Louisiana uses above-ground vaults) and very remote places will sometimes just have a plank of plywood to set the casket on next to the grave.
Here, the @worldfamousbodybearers have everything in control. The flag is off center but in no danger of sliding off. Once at the grave, they will set the casket down, bring the flag to “tabletop”, and eventually fold it and hand it off. They have control over it, directly or even indirectly (as shown in the photo).