Translation:The red hat goes well with her dress.
Ask yourself if that makes sense logically, considering the nature of an idiom in the process.
When we say "goes well" do we mean that? Does the hat go anywhere in a particular way? Nope. We mean the dress looks nice in combination with the hat.
Idioms are meant to be translated according to what they mean not what words they are made of, that is the entire function of an idiom.
"How are you?" - Why should Duo accept that as a translation of "ca va?". There is no "comment" there, no "vous" or "tu". Yet that is a good translation.
Does that all make sense? I can't tell.