Amar Subramanya is joining Apple at a critical time when the company is facing setbacks in integrating AI into its products.