Is my SAMD21 bricked due to a wrong clock configuration from software?
I have no experience with the SAMD-devices, but from my experience with other controllers I would say:

If you would have erased the flash successfully there would be no program to set the clocks, so the device would become accessible after a power-cycle. I doubt that you deleted the flash. 

In especially hard cases (I once disabled the SWD pins accidentally as first instruction in my controller) connecting the reset pin to the debug interface usually helps as there often is an option called "connect under reset" or something like that. The debugger will then make use of the reset pin to get into the device even if the software running on it would prevent it otherwise.

Note that it is important that the debugger has control over the reset line as just holding it in reset will prevent the controller from running. Depending on how fast your program gets to the bricking point you might get away with a good timing between manual release of reset and clicking connect on the PC, but that is usually very inconsistent.



Sidenote:

REG_GCLK_GENCTRL = 0x000003;
REG_GCLK_GENDIV = 0x000103;
REG_GCLK_GENCTRL = 0x010603;


Who the hell is supposed to understand what you are trying to do here? Use predefined values for setting register values for hardware. Something along the lines of GCLK_GENCTRL_GCLK3EN or whatever will make it much more understandable. I'm not going to look up all those bits you are messing with. This introduces a hell of possible bugs because a small shift error will cause disaster.