yeh, i don't think it's meant to come apart like that
usually what you have in your hand there is integral part of that plastic pipe assembly you pulled it out of. to remove and/or replace the MAF you'd have to undo the jubilee clip i can see in front of it in your picture. at the rear there should be some kind of clamping mechanism or another clip, maybe it's bayonet-locked. there are gazillions of different form factors for every respective vehicle, it seems (vielen dank, BMW ingenieure!), i don't know my way around the N57 but seeing that jubilee clip in front of the MAF, i'd say it's meant to come apart at that point.