Ok, I did some more test, MLVFS has the same problem and indeed it does not seem to be related to Danne's code (input looks OK).
I tried to disable fullres_blending, but it does not fix the problem.
I also tried to use constant values instead of using match_exposure function (I had an intuition about it too), but it still not improve things.
Edit: Using the dual ISO preview mode shows the same problem and has a total different algorithm.
I keep searching on my side.
Thank you
Edit 2: I played with dual ISO preview mode function, if I give constant value to a and b (line ~200) values, it's OK