Yes, you are rolling the dice. The 14 AWG wire is totally inappropriate for a 20A circuit, and now you must downbreaker to 15A to make that circuit safe. What were you thinking?
"Wait, how come the switch gets to use 18 AWG wire? That is proof positive that you are allowed to downwire anytime the expected load is low."
That's what you were thinking. That is reasonable logic, I must agree. However it is still wrong. Everyone needs to follow the rules. For you installing wire, you must follow NEC.
For the equipmemt maker building their equipmemt, they must follow product safety regs and UL's guidelines. UL then takes a specimen of the as-built machine and runs it through a series of torture tests. These tests are designed to simulate worst case scenarios. I suspect that the equipment has internal fusing, not actual fuses (that would cost money) but rather, intentionally narrowed traces on the printed circuit board. There is an art to handling mains voltage on a PCB.
Suffice it to say, UL is satisfied the 18AWG wire is safe, or they would not have listed it. And remember, part of the UL listing is the labeling and instructions. You must follow them when installing (NEC 110.3b) and the instructions say it must go inside a junction box.
Is your 14 AWG wire inside a junction box? No? Because that scenario - 14AWG wire in walls on a 20A circuit - has also been tested, and did fail.