Your solution is failing as S.QUANTITY is NULL, so any arithmetic on it will result in a NULL answer. You will need to check for null, and replace with a valid number, for example 0.
The following should work:
ISNULL(P.QUANTITY,0) - ISNULL(S.QUANTITY, 0) AS ClosingQty
The real question, though, is why is S.QUANTITY null in the first place?