I published a single-file plugin that does the same thing, as a gist a few weeks back: https://gist.github.com/hughc/f69e46c3b624d9bb180595f5567fc654

The basic premise is the same - query all posts, get post_content of each, and then use the parse_blocks() function to break that blob of commented html into its constituent blocks.

I used it for a similar reason, I had gone a bit install-happy on several sets of custom blocks, including a few I'd written myself that I wanted to retire.

Frustrating that there's no means to do this out of the box with Gutenberg.