You will see this from time to time. Don't sweat it.
Assuming that you are competent and can do the job well, I would take rudeness as a hint and run.
I like to tell stories, so here are a few that may help you understand that everyone goes through these kinds of insults.
Background: I am a retired systems internals engineer and consulted to Digital Equipment Corporation and wrote quite a few important components of their operating system. I often wrote in assembly and machine code. As well, I was an expert for quite a few operating systems for other computer companies throughout the years consulting for others such as IBM, Wang, and Microsoft, as well as all the major telecoms, pharmaceuticals, the World Bank and the IMF transferring more money each than the Federal Reserve. I worked for DEC Labs, Bell Labs, and BT labs. I worked as a consultant for 30 years and was asked to do computer forensics for recovery, discovery, and systems compatibility. I was often asked to testified in court and my testimony often caused the opposition to either quit or compromise. As well, I was given many failed projects to fix or work on including one that earned $250 million per month. I do not say this to brag. I say this so that you know that I brought resources to the table and incapable was not in my vocabulary.
One place gave me a test to take and then told me I did not have the aptitude for the job or even within IT. I had just come to them from DEC (Digital Equipment Corporation) as a request to help them.
Another gave me a test and because I stated that because I would never create a FAT file system for Windows NT that I was incompetent. This company failed six weeks later.
After more than a year of replacing Microsoft Mail with Exchange Servers for large global organizations with Microsoft as the customer, I was told by an IT manager for a bank that I was not qualified to run their Exchange Server. I did not call them. It was suggested that they call me by Microsoft.
New management for a company told me that I was not a strong technical employee. I was recruited as one of the worlds 5 top DEC experts. All the while I consulted to DEC (Digital Equipment Corporation) to fix customer issues when they could not figure it out. I consulted to DEC as a world expert of their systems and operating systems helping development teams sort out details they did not understand. I wrote assembly and machine code routinely for DEC, had written several components of their OS, and routinely performed high profile large scale installs and upgrades for the companies customers selling more equipment as a result than any salesman they had. I even worked for DEC Labs and Bell Labs at the time.
One kept calling me in for an interview. I had already met with two VP level managers who specifically wanted me to fix the problem and knowing my reputation only called me to do the work. The local IT manager clearly had infrastructure issues that forced him to reschedule 7 times each time commuting 40 minutes there and 40 minutes back. At the end, without an interview, he declared that I was not a strong enough candidate to take on the task. The local IT manager was fired soon after.
One interviewed me and told me I was not qualified for the position, however, his boss insisted on interviewing everyone. So he went to get his boss, who turned the corner and said, "You're hired!" after seeing me from the end of a long hall. Why? Because I worked for his previous company fixing their global e-mail system which could not deliver e-mail within 24 hours. I did this in just three weeks by fixing and then replacing their e-mail system globally for Microsoft.
I was a "friend of the bank" to The World Bank and the IMF who had recently hired a new IT manager and told him to call me without delay to fix a specific problem. He did call and told me that I charged too much and hung up. I priced myself at half my normal rate. He was fired after just one week as a result.
I worked for a global telecom where I managed the hardware and portions of development for a project that earned $250 million per month. One member of the team changed teams that later merged as a result of a merger between company subsidiaries. I was to be offered a management position in charge of the project and the former team member refused to offer me the package. I was a consultant, he was an employee. He told HR I refused the offer and took my job. Then he stole personal software from me. Then he said he was separating the wheat from the chaff and tried to sever my contract. Meanwhile, I continued to manage much of the project, travel for the company, and spec and build systems for dozens of projects along with offering development expertise winning awards. In the end, he was fired for fraud and an audit could only find 40% of the equipment he purchased. Keep in mind that equipment purchases were always into the many millions of dollars. I continued to consult to the company fixing high profile failed projects for 6 years and became good friends with the CEO and Chairman of the Board because of my performance.
I came in to an organization as an expert of DEC systems and Ross Systems to solve an upgrade issue that was a complete show stopper. If you do not know Ross Systems, it is extremely complex and huge and requires a ridiculous amount of detail to understand. After three weeks diagnosing code and fixing quite a bit of it for Ross Systems who asked me to take on the take for their customer, Ross Systems rolled my code into place for all of their customers. One other consultant who I previously hired to manage the business aspects of an association and had no technical expertise at all came into the office and told them I was incompetent. Really? I just fixed their airport management system which managed several airports and got them out of a serious legal jam.
I could go on and on. And you get my point. As long as you are professional, knowledgeable, and competent, do not let what people say affect you. Just be confident in your worth and never over-sell yourself so that you can always take on a new task with assurance of success. Just do good work. Plain and simple. That is how I succeeded and had a wonderful work life that I would not ever trade. A friend of mine often said (in latin), Do not let the bastards get you down. I suggest the same for you.
[Edit] In response to comments. My point was to create a contrast that makes the jerks stand out. Without the contrast, who was to say the jerks weren't right? Without quite a few examples, how can I convey that this is actually common? I was blessed to come into IT at a time where mainframes were king and mini mainframes the all new rage. There was really no PC at the time and hardly no software packages to buy. You had to write it yourself. Oracle did not exist for example. You mostly had to write your DBMS yourself. I was also blessed to come into an amazing environment that allowed me to get into the details of how systems work and break things if necessary. That in turn allowed me to understand how to fix things which I spent the rest of 30 years doing. Lastly, working in D.C. allowed for some amazing opportunities not found anywhere else with government, many NGOs, associations, corporations, telecoms, the Internet, etc. There are plenty of things I suck at. Believe me! I was blessed to find a niche for myself that matched how my limited brain works. Otherwise, I am the absent minded professor type that cannot find his glasses on his head or his house keys in his hand. Cheers!!