Even if our beloved Rasoolullah did curse an orphan girl there will be very correct reasons for it. Remember in Suratul Kahf when Musa (as) was with Khidr (as), Khidr (as) killed a small boy and it alarmed Musa (as). But later Khidr (as) gave the correct reason for it, since the boy was born a kafir and the justification for doing so.