The .40 cal. P99 has a heavier slide than 9mm. That's one important difference. You can see the 9mm slide is scalloped near the front to reduce mass. There are probably other internal dimensions that would differ as well. Springs are another consideration.
The 9mm barrel is smaller than the 40 cal - so a 9mm barrel in the 40 cal slide probably would not work. Conversion barrels are made differently. A 9mm conversion barrel would have a thick, wider barrel to make up the size difference in the slide.