Chosen Solution
I had recently changed my switch shell and everything was working so far and then I connected my left joy con and it will work but it won’t charge, so the only way I can use it is on the switch itself. My right one works fine but my left won’t charge.
Either you don’t have the battery connected, or your battery is faulty! Try unplugging then replugging the battery connector on the joy-con and see if that works! It could also be the connector for charging the left joy-con, try unplugging then replugging the connector on the switch itself, as well as inspect the cable/wire for both battery on the joy-con and charging cable for switch!
I had the exact same problem (changed the shell, left and only left joy con didn’t charge but still worked while docked), and when I went to my local game shop they docked my left joy con to a different switch console. The battery indicator said it was fully charged, and when I docked my left joy con back on my console, the battery indicator was working, and it was fully charged. You can also try updating the joy con firmware under settings, which I did as soon as I got home, and haven’t had problems since. Hopefully this helps anyone in the future with this problem.