The instructions look similar but are intended for different uses. TRAP is in fact any unimplemented instruction in the S12(X) opcode map. So for S12 it is actually 202 opcodes and for S12XD it is 29 opcodes.
There are two disadvantages to using a TRAP instruction rather than SWI:
1/ The interrupt will be called by any of the unimplemented opcodes so any unintended software execution could cause a call to your RTOS kernel rather than being handled as an error.
2/ The TRAP availability is different on different CPUs (S12 vs S12X V1) and so code compatibility could be an issue for a flexible piece of code like an RTOS.