The trim in my house won't hold paint. Is there a solution to this?
Paint needs pores to adhere properly.
If the substrate is very smooth or glossy then it should have been prepped in some way such as:

Shellac primer
Lightly sanded
Rubbed down with denatured alcohol
Oil-based primer

Oil-based paints tend to self-etch the surface



The painter is probably not at fault here since you probably paid them to just paint the trim and not fix the previous owner's mistake.