Simona Halep was beaten on her return from a doping ban, going down in three sets to Paula Badosa at the Miami Open.