I now created a reproducible example of the weird type inference: Need help with incomprehensible typeinference