Yeah, I can see how a rewrite makes sense. It's not rewriting diskutil itself, it's adding a new UI, that presumably uses newer APIs that will be easier to maintain in the future.
The problem really is that the new Disk Utility is a minimal viable product, rather than an app that can actually do everything the diskutil command line utility can do.
And then you have terrible bugs like this, which is presumably a non-security engineer writing a bit of UI code that they shouldn't be. I doubt this bug actually came from the APFS encryption itself.