A tyrannical state will not care that you are "legally" allowed to own firearms, and rebels do not get rights.
Also, I'll believe the claim that 2A is to prevent tyranny when I see it, because most of the time when you ask someone who supports the 2nd amendment about slave revolts, you tend to find out how little they care about "tyranny"
I'll point to a more recent example: the Los Angeles riots in 1992. Koreatown was protected by gun toting citizens, literally fending off the mob. (Whether we categorize the mobs as tyrannical is more pedantic than anything else, the men with weapons maintained their agency because of the threat of lethal force. Guns against a government yield the same end, maintaining agency when others may try to take it from you.)