Defender scan gets stuck, 500 error

When running file scan, Defender gets stuck and returns a "500 Internal Server Error".