No, Elves are not immune to Hypnotic Pattern, but their Fey Ancestry racial trait gives them gain on preserving throws versus remaining charmed, that may help them resist its effects. The spell finishes for an impacted creature if it will take any harm or if someone else works by using https://www.youtube.com/shorts/2bqrDoavYZM