Having chloroplasts does not always mean two organisms are close relatives
Some complex cells gained chloroplasts by swallowing other complex cells that already had them. This means two groups can both have chloroplasts even if their common ancestor did not. Sharing photosynthesis does not necessarily mean they are close relatives.