@xplitz, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project
See About the Installation & Troubleshooting category.
Assuming that you're using an 8-bit micro (e.g. Uno, Mega), 99999 does not fit in an 16-bit integer; change the type of keyfullnumber to long
long keyfullnumber = 0; // used to store the final calculated distance value
I'm not familiar with AccelStepper (and steppers in general), but above is a possible cause of your problem.