@UnicornTails2 It does sound like the XMP is the issue here. Without knowing the specs of your RAM, I can't search for any documentation, but overclocking memory can definitely cause system-wide issues, including crashes.
If you were using the motherboard's standard XMP setting, then your RAM itself should have been stable: memory is rated to run at the listed speeds, and the XMP at most will boost the RAM to that speed. (Boards have a standard speed based on Memory can be further overclocked with custom settings, but you wouldn't have done this without knowing it.
One possibility is that your RAM is slightly defective, stable at the board's default speed (I'm guessing 2133 MHz) but not the RAM's own advertised speed. Another is that you're using RAM that isn't supported by the board, or perhaps not supported at its max speed; you can find the list here:
https://www.gigabyte.com/us/Motherboard/GA-Z170-Gaming-K3-rev-10/support#support-doc
It's also possible that your board supports your memory but not at its fastest speed; again, I can't tell without knowing what modules you have. But regardless of the underlying cause, it sounds like you've identified the immediate problem.
If it makes you feel better, overclocking RAM is only likely to produce a very small benefit for systems with Intel processors. It makes a larger difference with AMD CPUs, but in your case, you might never notice the difference unless you ran benchmark tests.