If your bus is subjected to an internal border check (whether officially notified or otherwise), the bus will stop at least long enough for everyone who has no immigration trouble to be checked and (if the checks happen off the bus) get back on the bus. If anyone is removed from the bus because of immigration problems, there should be some additional delay to ensure that they retrieve all of their luggage from the vehicle.
As a short-term visitor with a valid type C visa, you would almost certainly be in the "no immigration trouble" group. If you're not, it would be for some exceptional reason such as doubt that the visa is authentic or suspicion that it was obtained under false pretenses. Another possibility would be generalized suspicion that you are involved in something illegal that isn't related to immigration (drugs, terrorism). Most people don't have to deal with suspicions of that nature, of course, but there are several factors that could make it more likely; these are beyond the scope of your question, but I mention them in the name of being thorough.
As noted in the other answer, the chance of this happening in this direction is almost zero. If you return by bus, the chance is much greater. I drove past Zagreb, Ljubljana, and Venice two days ago, and there were border controls on both borders, and there were a couple of buses stopped at the Croatia/Slovenia border (I don't remember seeing any from Slovenia to Italy, but the delay for automobile traffic was less, so I had less time to look).
When I drove past Venice and Trieste into Istria three weeks ago, there was nothing happening at the borders at all. I didn't notice any controls for traffic in the other direction, but you can see from the traffic indications on your favorite map service that traffic moves very slowly in one direction and quickly in the other.