Hi Joey,
Thank you for your updated information.
What I am afraid now is your hardware USB routing problem. It seems your board is interfered by the EMI, because yoru problem is just caused by the PC is charging, that's why I suggest you to test the official board. Actually, I didn't meet your problem on my side when I use the USB bootloader.
I am wondering, you also can check the FRDM-KL27 board, do you use the same circuit in the USB part?
This link is the FRDM-KL27 schematic:
https://www.nxp.com/webapp/Download?colCode=FRDM-KL27Z_BOM_SCH&appType=license
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------