-snip-
Why you in code deduct only Y coordinate ?
-snip-
Because point substraction operation it is addition operation where y-coordinate is negative in deductible point.
Python code give you correct result only if you are used him in correct way.
pointstr should be compressed pub key that start with 02/03 and with length 66bytes(index 02/03 +x_coodinate).
pubkey that start with 04 it is
uncompressed pub and have length 130 bytes(index 04+x_ccordinate+y_coordinate).