@fbasaris The fact that you're using a ATSAMD21G18A greatly simplifies everything from a software standpoint.
Also, the fact that the microcontroller did connect and upload the "blink" sketch at one stage, suggests that it might be a start-up issue, (or possibly be a solder joint somewhere)?
It's probably worth inspecting board and checking if there's a 3.3V supply to all the VDD pins. The VDDCORE pin should be around 1.8V or thereabouts.
I know it sounds silly, but it might also be worth trying to waggle the USB plug in the board's USB connector, or try a different USB cable.
Start-up issues can be related to the external crystal. One way to test this is to use a the UF2 bootloader binary from a crystalless board, such as the Adafruit Itsy Bitsy M0. This uses the microcontroller's internal 32.768kHz oscillator, or the USB's 1kHz SOF (Start Of Frame) pulses instead.
The UF2 bootloaders normally set the microcontroller's BOOTPROT fuse, to protect the bootloader from being overwritten, therefore it's usually necessary to reset this fuse back to 0x7 (or 0 bytes) before uploading a new bootloader binary. (The Arduino (Zero) SAMD21 bootloader doesn't set the BOOTPROT fuse at all).
If there is a problem with the external crystal and you're using a crystalless bootloader, after a double tap reset, you'd expect to see the board connecting to the host computer/Arduino IDE, as well as the LED pulsing. It should be possible to upload the sketch, however it will fail to run the moment crystalless bootloader hands over to the crystal driven core code.
The board's core code can also be switched to crystalless operation, by inserting the -DCRYSTALLESS flag into the compiler command line in the board's core code "boards.txt" file, for example on the Adafruit Itsy Bitsy M0:
adafruit_itsybitsy_m0.build.extra_flags=-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M0 -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS {build.usb_flags}