How a private key can be invalid?
A bitcoin private key is a number greater than or equal to 1 and less than X, where:

X = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141


That's in base 16. In normal base 10 numbers, that's:

X = 115792089237316195423570985008687907852837564279074904382605163141518161494337


Any number outside of that range is an invalid private key. That includes 0 and X, X+1, X+2, ...