I have implemented a fix by my own, thanks for the hint @ppieczul
I will follow up on this topic here:
EDIT: The bug is fixed in 2.5.8