Not 100% sure if other mods play into the game - I only managed to reproduce it with angels mods, especially Angel's Bio Processing.
Btw, you need to trigger "script.on_configuration_changed" for that code of the library to run - not 100% sure when that is called.
Using a non-current version of Angel's Bio Processing, creating a recipe in a chemical plant, setting fluid permutation, saving, updating the mods, loading - that should reproduce the issue.
Also, here's a save, just load with up to date mods: https://www.mediafire.com/file/d5zpcqjrxctkasn/tmp2.zip/file
Thanks in advance, if I should investigate further, just tell me.