Judge blocks Musk’s Treasury takeover, calling it ‘chaotic and haphazard’