Oh. Stupid. Working too hard! I neglected to realise the grace note time value sets the value for the next note where it was not specified, as I added in the grace afterwards.
Many apologies for some particularly stupid noise. How I wish we could delete posts sometimes.