It was priced in, the share price prior to the news being released was taking into account a probability measurement of the trial succeeding or failing. You can’t price in both options of a binary outcome simultaneously, so part of the equity price was functionally equivalent to a call option on the outcome of the drug trial that only resolved after the trial results are announced.
It’s similar to the situation where a company puts out a public offer to buy another company at say, $50 a share on a day that the acquisition target is trading at $40/share.
If the stock of the target company is trading at $46/share, the market is pricing in the probability of the acquisition not happening. If the market knew the acquisition would happen with 100% certainty, the price of the target company shares would be equal to the buyout share price offer. You can assume the risk of the acquisition not happening by purchasing shares at $46, and if it does end up going through, you earn $4 a share from assuming that risk.