You are missing an important rule...
Each 3x3 sub grid should contain all elements 1-9
otherwise, this would be valid, shift position by 1 each row like:
123456789
234567891
345678912
456789123
567891234
678912345
789123456
891234567
912345678
Here is a solver I wrote a while back