I reapplied thermal paste multiple times, but that wasn't the real problem

No, it wasn't the cooler either. Just how it was mounted.