Connecting them in parallel means the solar panel's 24V output gets mixed with the car's 12V systems. It's not uncommon for car systems to run a little high like 14-16V to charge the battery but 24V is definitely quite on the high side. That might make the lead acid battery explode and will probably damage other systems as well.
This might be fixable with diodes but I feel like that's probably still not ideal to try to mix 12V with 24V on the same circuit. I would put a switch and have it be like a toggle kind of deal. Or maybe some connector that toggles a switch on insertion similar to headphone jacks that disables the speakers when plugged in.