The limpet mines were supplied to the Argentine government by Italy. They likely would have been traceable. Quite aside from the fact that the British were reading the Argentine's diplomatic messages (whether they would reveal that publicly might be another matter - but they might reveal that in private to some/all NATO allies).
After blowing up?
In any case, whether the mines were traceable, the men weren't soldiers, etc, it's a moot point, as it's war, not a court of law. The most the Junta could realistically hope was either for the UK to refrain from invoking NATO article 5 or for a few members to buy into the charade of "Totally not us", which would be unlikely - otherwise, they'd be telling the USSR all they need to do is to send some Spenatz commandos without an identification and deny responsibility.
And it's not like, assuming the frogmen escaped undetected, the world would read about a British ship blown by a mine at Gibraltar and think "accident" or "ETA" while missiles and bombs are flying through the South Atlantic
Because their government was run by a bunch of fascist loons, and the looniest of the lot decided, authorized & planned on the operation, without even consulting the other 2 fascist loons.
It's not that they
might have tried this - they
did actually try this in real life - but were too incompetent to do the operation (they also considered attacking in the UK) -
https://en.wikipedia.org/wiki/Operation_Algeciras
Actually, had Anaya authorized the attack on May 2nd, the operation would have been carried out
But why would Argentina have done that anyway? Say what you like about the junta, their claim was to the Falklands, not to Gibraltar. If they attack somewhere far, far away from South America—whether or not it can be formally pinned on them—they lose a lot of sympathy from the sort of people who believe the Falklands are a British colony in rightfully Argentine land and the British are waging a colonial war against Argentina. It's kind of difficult to claim you're fighting for the freedom of your people oppressed by the thousands-of-miles-away British when you attack somewhere close to Great Britain and thousands of miles away from you.
Because Argentina and the UK were at a shooting war?
How do they get there? Why isn't RN protecting one of more important harbours in what is war time?
Because the British aren't the invicible übermensch who can do no wrong AH.com tend to depict. To quote from the Wikipedia article
For the first few days, they surveyed Algeciras bay in search of the best place to enter the water and to observe the maritime traffic in and out of Gibraltar. There was not as much surveillance in Gibraltar as they had expected: two sentry posts were unmanned, and only one navy vessel patrolled the area around the port.