I did some more research and it doesn't appear that HWA have the ability to develop an engine from scratch. They developed several engines for motorsport, but all were based on existing units. They also did the engine for the Apollo IE, but that was, again, based on the Enzo engine. HWA were also the guys who did the CLK GTR and are a partner and supplier to Mercedes-AMG, so taking a Mercedes engine and modifying it is pretty much in the middle of their ball park.
Yes, Pagani are saying in their own release that the engine is "designed from the ground up," but you need to take into account that's what all the companies that take an engine and modify it in some way say. After all, if you change some part on the engine, it's not the same engine as it was before, right? I would still bet anything it's heavily based on the Zonda R engine (or some other Mercedes V12 possibly) and it's using the same block at the very least. As I mentioned, for a run of only 30 cars it would make absolutely no sense to develop an engine from scratch (which costs an absolute fortune) instead of taking an existing engine and modifying it - especially since you've already engaged the one company that specializes in exactly that - modifying Mercedes engines for racing applications.