Can we use Breakthrough Starshot spacecraft to detect any unknown massive object in our solar system? For example, the hypothetical Planet Nine.

Since we just want to prove or rule out the existence of Planet Nine in our solar system, we can avoid most of the technical challenges for StarChip (camera not required, lower propulsion power, etc). So StarChip would become much cheaper, and we are able to launch thousands of the probes, covering a large area of the sky. If a massive object exists within the area, it will affect nearby passing probes and lead to trajectory anomaly, which maybe detectable and the trajectory data can be used for calculating the possible position of the object, and then we can do some follow-up observations and studies using telescopes.

Actually we can use other probes, but StarChip seems cheaper and has faster speed so that we don't have to wait too long if the targets are thousands of AU away from us.

So could this technique be used for detecting Planet Nine or any other unknown massive object in the solar system?
What's the appropriate speed for StarChip so it can accumulate enough gravitational effect to be detectable?
This is an interesting question but the answer is that this is not feasible nor efficient at all.

You can regard each photon of light coming from outside the Solar System acting as a probe. We can measure the deflection angle of them by analysing the gravitational microlensing effect a planet would produce on them. For that you need two things; a planet massive enought to be spotted by this effect (predicted mass for Planet 9 is in place) and enough photons coming from different directions to have a chance of some of them passing close to Planet 9. And here's the thing: the net flux of incoming photons from all the stars and galaxies from all directions into the Solar System is still not enough to have even the slightest chance of some particular ray to be deflected or blocked on its way to an observer on Earth that would be just looking in that precise moment in that precise direction (as Planet 9 misaligns with that particular star from which the photons are coming after a few minutes). This could be changed by continuous observation of the entire sky, so maybe when LSST opens in 2022 we might have a chance to apply this method of detection.

So, if all the photons coming to Earth from outside the Solar System could be used as natural probes that might show Planet 9 by microlensing or occultation, immagine how puny would humanity's effort be in comparison if we tried to launch even just a fraction of a millionth  of the amount of photons currently traveling towards us from all directions.

There's also the inverse method (which is more similar to the 'launching probes to the outside' idea): photons coming from the Sun (which are a lot more than those coming from the stars and are been "launched" in all directions with higher coverage of each square degree of sky) could hit Planet 9. We need the information of those "hitting probes" to get to Earth and this is difficult, many of our solar photon probes are going to be reflected in directions unaccessible to us and many more are going to be absorbed by the atmosphere and surface materials of Planet 9. But since the Sun is emitting so many photons a few percent might actually come back to the inner solar system in just a few days. Those reflected photons are our best chance and indeed they are the ones we are searching for when we try to find direct evidence of Planet 9.

No human attempt to launch trillions of probes to the region of the sky we expect to find Planet 9 (even if we manage to reduce it by many orders of magnitude) will be as productive as the Sun launching so many photons continuosly and Planet 9 reflecting them back to Earth. To compete with that we would probably need more mass than the mass of the entire Solar System to make the tiny probes and no gain at all compared to the reflected photons that are in place right now.

I guess there is a minor detail we could talk about: reflected photons have to actually hit the target and our tiny probes could just pass close to it and signals would reveal, by some Doppler shift, a change in speed and thus the gravitational influence of the body. So actually we have to talk about the cross-section of the planet in a different way in both situations. For the photons coming from the Sun to be reflected back the considered cross-section would be the cross-area of the planet which for a planet the size of Neptune is $1.9 \cdot 10^9 \; km^2$. In the case of the nano-probes the cross-section can be expanded to the region where the gravitational influence of the planet ceases to be sufficiently large to perform a detectable change in speed for the tiny probe. I'm not going to calculate this but let me make a liberal guesstimate by using the expected Hill sphere for Planet 9, which is $15 \; AU$ in radius and thus would make for a cross-sectional area of $1.6 \cdot 10^{19} \; km^2$. That might be great for having some chances but the probes would have to be moving extremely slow for the gravitational influence to be able to operate for enough time as to make the deflection be apparent, and this is a constraint that makes the project again unfeasible since our probes would be moving at some percents of the speed of light (if not then we would have to wait centuries or even millennia for the experiment to be completed).