When I was in college I was a philosophy major for four semesters and I heard in multiple classes from multiple professors that unicorns supposedly do not exist. Unicorns also had their own section in the Stanford Encyclopedia of Philosophy's article on "Non-Existent Objects." This was one of the reasons I switched to a different major. Humans have only a limited knowledge of the world around us so why do philosophers think they can know something like this?
The properly philosophical respose there would have been to ask the professor in a friendly manner how he/she knows that unicorns don't exist.
I think that what's typically happening is that they are using unicorns merely as examples of non-existent objects to address other philosophical problems such as how words and phrases can refer to non-existent objects, how propositions about non-existent objects can nevertheless be meaningful, and how propositions about non-existent objects can have truth values.
Sherlock Holmes is a fictional character, but it's true (in some sense) to say that he is a 19th century British private detective and not a 12th century Byzantine cleric. There's philosophical interest in exploring what that "in some sense" consists of. What
is a 'fictional character'?
There's a whole philosophical literature about those kind of issues which I expect that your professor knew about and was probably trying to address.
Saying that unicorns don't exist also seems to go against what I thought metaphysics was supposed to be. Shouldn't the philosopher practicing metaphysics start out with no assumptions about what does or doesn't exist? Why can't philosophers just admit that they don't know whether unicorns exist or not?
Your professor probably would have if you had put the problem to him/her that way.
My own response is that I know of no convincing reason to think that unicorns exist as physical animals, as opposed to items of folklore. I can say this with a reasonably high degree of subjective conviction, but not
apodeictic certainty. I can't conclusively exclude the possibility that a unicorn exists out there somewhere that I'm unaware of, but for all practical purposes I don't believe that one does.
Interesting questions about the nature of faith arise here, btw.
It's kind of sad and even tragic to see people fumble their chance to pursue a philosophical education because they have valid philosophical intuitions like you seem to have had. I'd suggest that you give it another go.
Sometimes it's best to set those kind of objections aside for the time being and attend instead to whatever point that your professor was trying to make by using the example. Perhaps walk up after class and put your question to him/her. I expect that most philosophy professors would be impressed by that and might start thinking of you as one of the brighter students in class.