Out of curiosity, do you remember if you entered "You need to sleep" or "You need sleep"? The former is a valid translation.
When चाहिए is used along with the infinitive form of a verb (here-सोना-to sleep), it becomes 'need to' or 'should' (i.e [verb]+चाहिए=should [verb]) .
चाहिए is want/need when used with a noun (i.e, [noun]+चाहिए=need [noun]). But 'सोना' does not mean the noun 'sleep' so "You need sleep" is not a correct translation to this sentence.
However, as Pramod454198 has pointed out, सोना has another unrelated meaning - the noun 'gold'. So, the sentence तुम्हें सोना चाहिए can be used to demonstrate the second meaning of चाहिए as well and be translated as "You need/want gold".
Sam362597, your post is a month old, so you might have figured it out by now. Sorry, if my response is redundant. My modest input: In a construction "infinitive form of the verb +चाहिए", the word चाहिए means "should" - for example: "सोना चाहिए - should sleep", or "जाना चाहिए - should go". While in the meaning of want /need infinitive + "चाहती (f.), चाहता (m.), चाहते (pl.)" forms are used.
The verb चाहना and its other forms except for चाहिए always mean 'want'. चाहता is the masculine singular form, चाहती is the feminine form and चाहते is the masculine plural form.
Eg: राज बैंगलोर जाना चाहता है। - Raj wants to go to Bangalore
वे सोना चाहते हैं। - They want to sleep
जनता शान्ति चाहती है - The public wants peace
On the other hand, चाहिए can be treated as a separate word of its own. It means 'should'/'need to' (when used with a verb) and 'need' or a stronger/more immediate form of 'want' (when used with a noun)
मुझे बैंगलोर जाना चाहिए। - I need to go to Bangalore
उसे आकाशवाणी पर गाना चाहिए।- She should sing on the radio
नेहा को सौ रुपये चाहिए। - Neha needs ₹100 (expresses a stronger sentiment than नेहा सौ रुपये चाहती है)
मुझे आम चाहिए - I want a mango (expresses a more immediate sentiment than मैं आम चाहता हूँ as in you are saying you want a mango right now rather than at some point in the future)
Great answer; thank you. This should be in the lesson tips, or stickied somewhere.
For some reason I had a memory that using the direct form with a noun (e.g. मैं आम चाहती हूँ ) was considered less polite, but from your explanation it sounds like that's not the case and it's in fact milder than मुझे आम चाहिये. Is either version considered brusque, or am I confusing this with some other language's similar expressions?