I have a Specialized Cirrus Sport hybrid and recently replaced the cassette, chain and chainrings (which were very worn). I replaced my Shimano 9 speed 11-32 cassette with a new Sunrun version (also 11-32 and 9 speed), my Shimano 48/36/26 crankset with a new Shimano 48/36/26 (with cranks about 5mm shorter as that's all I could find that matched the tooth numbers) and installed new a 9 speed chain. When i test rode it I found that the rear gears would occasionally slip. I checked the bike over and noticed that the derailleur hangar and derailler bolts were a bit loose so thought that must be the problem. I tightened them up but still the gears are slipping. I've tried indexing the gears, B limit screw, and adjusting cable tension, removing the cassette and installing it again, all to no avail. I've replaced drivetrains many times before on different bikes and never had a problem. I can't imagine that it would be the slightly smaller cranks so the only thing I can think of is that I should have got a better quality cassette than the Sunrun. Could this be causing the gears to slip?
Most likely cause is the shifter cables are binding. My recommendation would be replace them with new ones, consider new outers as well as inners, these are relatively cheap and new inner and out will eliminate the problem or eliminate cables as being a part of the problem. If you want, you could try lubing the cables. If this works, the it shows the cables were the problem, and you may want to replace them anyway, after spending all the money on new components you might as spend a little more and get the very best from them you can.
A bent derailleur hanger is also on the cards here. You can eyeball and confirm a hanger is badly bent, but a tool (or really good eye and experience) is needed to state with certainty the hanger is not bent.
If cables are not the problem, as already identified, a weak, or even broken derailleur spring could be the cause. Inspect the derailleur for a broken spring, clean and lube it if the springs look good. In my experience, derailleurs have to be very well worn to cause chains to skip.
So steps I would take :
Lube cables and see if it improves, if so, replace cables Eyeball hanger to check its not bent Check and clean/lube derailleur.
If no improvement, check hanger with alignment tool and consider new derailleur (Visit to bike shop might be best at this point).