Well you got another good laugh out of it from me LOL
As an Iranian-American, I've made similar blunders in trying to communicate with my Mexican friends and colleagues. "Hey amigo, do you need a chauqeta?" I would ask to the eruption of laughter. If you look up "Chaqueta", translation services will happily tell you it means "Jacket". Don't trust it. Apparently to some Mexicans it also means jerking off.
Somewhat kinda related: I grew up in a Brazilian town that borders one of our many Spanish-speaking neighbors. We used to make fun of the folks across the border for pronouncing pizza like piça (“pissa”), which on our side of the border was a vulgar word for penis.
I think your friends were just being jerks. The primary meaning of the word is indeed "jacket". It'd be like saying to someone "I need a blunt tool" and them making fun of you because you just said you need a tool to make cannabis cigarettes.
It's not because it's technically right that it's not funny. Your english example isn't particularly funny so you wouldn't have the same reaction, but you could easily imagine plenty of sentences using "cock" or "pussy" that would be.
I know that some cultures consider it rude to laugh at this sort of things when it's not the speaker's native language (brits don't even correct me when I misuse/misspeak english because they think it's rude), but for many (most?) cultures it's really not, that's not being a jerk
I've come to the general conclusion from experiance that people whom only know their native language are at best moderately hostile towards other languages and multi-lingual people.
This is a regional bro distinction. I have certainly heard chaqueta used by respectable people in Jalisco. This joke is a reflection of people that don't travel.
In Jalisco y Nayarit the normative word for the large beer bottles is caguama. In central MX that word is ghetto.