Hello obliviuz,
Thank you for using Apple Support Communities. We want to help get your MacBook Pro to charge properly. If your MacBook Pro isn't properly charging, we recommend that you review the following resource for steps you can try: If your Mac battery won’t charge - Apple Support
Here are a few steps that are listed within the resource we shared:
1.) Check the battery condition.
2.) Clean the port. Make sure the port is clean and free of debris. Disconnect it from the power adapter and clean it with a soft, dry, lint-free cloth.
3.) Use a different Adapter. You already mentioned you tested a different cable, perhaps a different adapter might need to be tested.
4.) Run diagnostics.
More steps can be found in the resource we shared. You also mentioned that this issue doesn't occur while at home. It's a high possibly that your car might not be outputting enough power to charge your MacBook Pro. To further isolate this, test to see if you're able to charge in a different car. This will give us a better understanding on why this issue is occurring.
If you isolate this issue to your charging cables, then you can follow the steps listed here: If your USB-C power adapter isn't charging your Mac laptop - Apple Support
We hope this information is helpful. Thank you for using Apple Support Communities. Cheers.