Maximum Power Point Tracking for multiple sources
What you need is two MPPT controllers. You might be able to find two in one box with some shared components, to implement your first diagram (I don't know and product selection is off-topic here), but inevitably what you're doing, electrically, will be two MPPT controllers because you have two power sources, each with their own source impedances which must be tracked separately.