I've still a lot to learn about DOS development! Weirdly, it works fine on a FreeDOS machine I've got, but not on Win98 and PCem shows up the problem for me too.
Thanks for the offer of help - I'll try stripping it back to narrow down the problem, and pull together a larger collection test environments, starting with your PCem tools!