We make every effort to accept every correct form of the languages we teach. And yes while Duolingo is US English based we include closet/wardrobe/cupboard for this translation.
Duo rejected your sentence for another reason and showed you the primary translation which happened to use "closet". But the error was not the use of "wardrobe" there must have been another error.
If you check the comment just above yours you'll see that "wardrobe" was accepted a month ago.
This could be resolved if you could post a screenshot showing the exercise, your reply, and the response from Duo.