That " glue " is solvent .
it dissolves the plastic at the joint and creates a weld .
the solvent then evaporates completely leaving the new , solid connection .
It also dissolves the acrylic resin in the paint .
It will dissolve enamel paint also .
Those types of plastic cement are essentially the same formula as many airbrush cleaners .
Butyl acetate and acetone . Sometimes also butanone or ethyl acetate when it's the " fast setting " variety .
You can glue pre-painted parts in place but you need to use a smaller brush to apply a tiny amount of that solvent to only the point of contact .
Dab on a small amount of solvent to the tab of the part and then quickly install it .
that way you avoid flooding the joint with solvent .
If you don't have a spare brush you can still use the bottle's brush - just hit the lip of the bottle with the brush to knock off the majority of the solvent prior to touching it to the part to be attached .