Just as Nikola Corp. took a step toward stabilizing its finances, it announced a big loss and a sudden switch in CEOs.