I analyzed the raw data in the DNG converted from ProRes RAW and now I know exactly how it's messed up.
I adjusted my tool and I think I have a working fix now. It fixes the raw data itself, so the result will be perfect in every software that reads DNG.
Before (see the broken line in the middle):
After:
I'm still testing my tool, it can read 12/16bit DNG, uncompressed, or lossless compressed, the lossy formats are not supported. It uses multiple threads, on my recent i7 laptop it converts with 25-35fps.
It's a pain to convert twice but at least I got it working, and learned a bit of C++ on the way.
If only I could fix the framerate issue as well, but no chance for that.