What to do with a last chunk of 503 bits in SHA1?
The answer is in both sources you linked.

Pseudocode from the Wikipedia article:


  
  append the bit '1' to the message e.g. by adding 0x80 if message length is a multiple of 8 bits.
  append 0 ≤ k &lt; 512 bits '0', such that the resulting message length in bits
  is congruent to −64 ≡ 448 (mod 512)
  append ml, the original message length, as a 64-bit big-endian integer. Thus, the total length is a multiple of 512 bits.
  


From the SHA documenation:


  Suppose  that  the  length  of  the  message, $M$,  is $l$ bits. Append the bit "$1$" to the end of the message, followed by $k$ zero bits, where $k$ is the smallest, non-negative solution to the equation $l+1+k\equiv 448 \mod 512$.


In both instances, the number is the smallest non-negative solution to the same congruency, just noted slightly differently. If you have an example where $-1$ would be a solution to the congruency, then the actual value of $k$ is $511$.