There is absolutely nothing wrong with that sentence, but it is not a direct translation of the Portuguese. I think DL demands the literal translation, because otherwise there could be dozens of acceptable translations. If a were translating a book, there could be any number of reason to translate the way you did, but computers are not very bright, and can only count as correct specifically what a human has told it is correct. Have you ever used google translate? It's very useful, but makes an absolutely awful translation of most things. BTW, are you a native English speaker. 'Cause if you are, then I probably misinterpreted your question, as you already know that your sentence is perfectly good English.
I translated: "It would be good if it stopped to rain" but was marked wrong. The supposed correct one was "It would be nice if it stopped raining". The only significant difference between my answer and the correct one was "good" versus "nice"; does the word 'bom' not mean 'good' here?