Attached is the simulation model for the single-phase multilevel converter, While I was trying to simulate the thermal performance of the switching devices.
However, whenever I start the simulation, it keeps telling me the power loss of the diode is negative.
While the concept of negative switching losses is confusing, if you look at the error message you will see that the device is used way outside its safe operating zone:
The device is seeing 20kA of current, which is causing a large extrapolation outside of the loss table data and causing an incorrect calculation of the result. In this case you have an issue with your model and should start there rather than worrying about the thermal losses. It looks like the individual devices are actually seeing approximately 100,000A current pulses in steady-state. You might want to unassign the thermal models and first debug the electrical circuit.