They worked in the garden, but they worked wrong? What did they dod wrong?

(Is the sentences grammatical? Do we have to use 'wrongly' instead of 'wrong'?)

They worked in the garden, but they worked wrong. What did they do wrong?

(Are the sentences grammatical? Do we have to use 'wrongly' instead of 'wrong'?)

Your sentences are grammatical, but your meaning is not clear. How can you work "wrong" in a garden?

The sentences you provided are grammatically correct. However, if you want to express that they performed their work in an incorrect or mistaken manner, using "wrongly" instead of "wrong" would be more appropriate.

To determine what they did wrong, we would need more context or information about their actions.