I wouldn't recommend squirting wd40 in. It won't help and you will inevitably get WD40 where you don't want it.
I'd start with a bleed and a full clean of the caliper and pistons. Whatever the issue is, those will need to be done, and it might even be sufficient to resolve the problem. It's vital to avoid a piston coming out too far so if you have any uncertainties about that, just go to a bike shop. Brakes are too important to take chances with. If the parts are under a Shimano warranty, I would think any bike shop could manage that.
Is the brake line routed internally or externally? If the latter, then it's not too difficult to remove caliper, hose and lever and keep them all as a connected unit to send back if you choose to go down that route.