In the first case, this is how Factorio works when the recipe has fewer inputs/outputs than the building.
In your case it has only the A and B inputs and the two permutations AB and BA are generated. I think it is not possible to have the same ingredient multiple times so generating AAB ABB would not be possible. It would also be problematic as it would suggest generating aaab, aaba, aabb, abaa, abab, abba, baab, baba, babb, bbaa and bbba if a building with 4 inputs exists. Same for 5, 6, ad infinitum.
On a side note in the case of Angel's mods using the "Chemical plant" instead of the "Advanced chemical plant" would yield higher crafting speed and eliminate the situation at hand.
As for the second case the mod should be generating that permutation. The threshold should not affect this as there are only 6 permutations. I will look into it, but I doubt the original code has just broken.
What version of Factorio are you playing and what version of the mod are you using?