It's an odd one for sure, cocaine was a well liked performance enhancer in the good old days but today it is a fairly easy product to find in tests and you would imagine it would be a thing of the past for the clever doping cyclist. These days it's a substance that is banned in competition but not outside competition, a rule that we've seen in practice as Tom Boonen tested positive in an out-of-competition test and avoided any UCI sanction.
The determining factor here is when the test takes place, in this case it was an in-competition test, even if it is theoretically possible that the substance was used outside the race since it is detectable in your system for many days. So should the B-test confirm the result then Paolini could face a suspension. He has apparently denied using cocaine when faced by the result and his Katusha team said it would support him until the matter has been properly examined. In the meantime though the rider is provisionally suspended.