The theory behind this is: if you negate K you get the same R and the negated S. Hence you need to negate S as a post-processing step, i.e., S' = prime - S in both cases.
Thanks. That's what I thought but wanted to confirm.
Did you use the right prime? It should be the order of the elliptic curve not the size of the prime field.
Tried both with the same result (invalid sigs).