Using the wrong model / using the model wrong
Using the standard definition, $W = F\cdot d\cdot \cos(\theta)$...
This warrants clarification. This is a definition / model of the work done by someone that is dragging a mass where...
- $F$ is the magnitude of the force applied on the mass
- $d$ is the distance that the mass travels
- $\theta$ is the angle between the direction of travel and the direction that the force $F$ is applied.
The usual case when you use this model is when dragging the mass over a surface. In this case $\theta$ is (also) the angle between the ground plane and the force that is being applied, because the direction of travel is in the plane. In that particular case the model holds true even if you assume that $\theta$ is the angle between the plane and the force $F$.
But in your case, this condition is not true. The mass is not travelling in / parallel to the plane. Therefore it is wrong to assume that $\theta$ is $\pi/2$ or $90^\circ$.
In the case of lifting the weight, the direction of travel is straight up. And since the direction of the force $F$ is also straight up, this means that $\theta$ is $0$.
So you have either used the wrong model by defining $\theta$ to be the angle between the ground plane and the force $F$, or you have used the model wrong by assuming that the direction of travel is $\pi/2$, or $90^\circ$ in relation to the force $F$.
So you are using the model wrong in that you are including the counter-force in the formula. This is not how the model was meant to be used, because then the answer will always be $0$. Technically it is correct when you consider both gravity and the one lifting the mass. But the formula then becomes a useless tautology because the result is always nil.
I say again: the model is used to calculate the work done by the one that is dragging the mass. It is not meant to include the work done by that which is providing a counter-force. You can, if you wish, but that is a pointless enterprise.