Not sure the point of the question really does not matter. If LH issued/sold you the "P" ticket and it has a LH flight number as far as miles it's zero miles even if on a AC metal.
Now a P on LH program it does earn miles, but as far as Aeroplan it's a Tango fare
Internally I would guess AC classes it a Z for executive class which is what AC would use for discounted Executive class.