was i in the wrong?

So, today my cousin came over, and everything was fine, we were laughing and stuff, and she suddenly made a bad joke where she mentioned that i had an embarassing secret. (to be exact, she mentioned that she remembered my secret but wtv) now i told her to not mention it ANY WAY this included not mentioning that i even have it unless we are alone. so my sister started laughing too and of course it embarassing. now i lash out really easily and she (cousin) KNOWS that. so i started like calmy at first saying „please stop its not funny anymore“ and stuff like that you know? like a polite „hey i think its time to stop“ and she started saying stuff like „oh but its funny to US“ and thats where i started to raise my voice. (i often raise it without realising and im trying to fix it so. my bad) and we started going back n forth (i mean an argument yeah) one argument that really annoyed me was „you dont respect my boundaries either!“ number one, she has NEVER set clear boundaries. i find it hard to spot when someone is uncomfortable due to being a pretty loud, noisy and stuff like that person. im not sure if its because of that but either way i find it hard. and i tell her like everything about me i think its to the point she knows me more than i do myself. i asked her what her boundaries are so i can follow them and respect them and she started just telling me „mhm“. after a while stopped but she refused to admit she was wrong and i hate these kind of people. after she left i had a pretty bad panic attack, like one i havent had in AGES. shes my favourite person, shes the only one i trust and i just feel hopeless. its like i cannot trust anyone

Your anger and the reaction is justified, you set a clear boundary and she crossed and proceeded to make fun of you for it. Yelling is only the communication that something is wrong and it needs to stop (in this instance.) You can however communicate to her that you need clear boundaries that are direct and strict so you have a straight forward ¨rule book¨. If she has done this multiple times e.g, using the excuse you have not respected her boundaries then its on her part to communicate how you are not respecting her boundaries rather then making a statement for no clear reason.

If her response is ¨mhm¨ to your active, direct communicate then it may be time to consider that she is not who you think she is regardless if you feel close to her, no matter how painful it will be to cut her out of your life.
-Shadow & Dark Sonic