A defining characteristic of elves is that they cannot be put to sleep by magical means.
Fey Ancestry
You have advantage on saving throws against being charmed, and magic can’t put you to sleep.
(from D&D Beyond)
Does this mean that if a wizard used the wish spell to put an elf to sleep, the wish would fail?
Best Answer
It's up to the GM
A wish like this falls under this section:
The question is simply: will something go wrong? Some possible rulings are:
Either failing or partly working could satisfy the Fey Ancestry feature (or one could rule that wish bypasses the feature), but I personally like the unforeseen consequence one. For example, maybe the wish summons an adult brass dragon that immediately uses sleep breath on the elf (dragon breath is not considered magical according to this Sage Advice article). Now you have a dragon who might not like being pulled from his home to settle your bet.