The 8va line needs to be anchored to a real note. The issue is if you delete a grace note it doesn’t leave a rest behind and so there is no anchor and the line disappears. Yes it still has an effect so it really is still there, but with no anchor it doesn’t know how to display itself (I am making assumptions since I don’t know how the code actually works. But I’ve also run into this before.)
If you really need to 8va line to cover the grace notes, the only way to do this is add a bar before the first and anchor the line on a note in the prior bar, and then delete that note. The 8va line will then anchor to that rest. Alternatively, anchor the 8va line to the first real note and leave the grace notes outside of it.
Or just don’t delete any grace notes after you’ve added the 8va line.