My BMW is the same - when you try and pull the filter & cap out through the little service hatch, the filter will invariably become detached..
You can, however, just about wiggle them both back in again as a unit to avoid the filter getting crushed. Once you've cleaned all the oil off yourself, of course, that came out of the filter housing.. (there is a drain bung on the filter cap, actually, but it is almost always seized in..)
Didn't they put it somewhere sensible, like on the previous v8
The M50(and derivative) engines put it vertical at the front of the head casting. Vauxhall's 1.0l triple is the same, as are other engines. This arrangement makes sense as it's easy to remove the cap, change the filter without making any mess, and reassemble without any issues. Replacing a horizontal spin-on filter with a large, separate, poorly located casting to hold a paper filter is an underengineered solution to a problem that did not, and still does not, exist.