I don't think it is as difficult as you've suggested and I wonder where you get:Nothing happens randomly if it goes about Billard. If you are thinking in this direction, also a perfekt cleanliness of the balls needs to ensured each time before you rack them up, same for the cleanliness of the cloth and rails.
One major problem will be: How do ensure that the balls are being placed exactly always at the same position? With the standard templates placed like usual by hand, I guess that such a high exactness can not be acchieved for sure, we are talking here about a tolerance of ~ 0,1 mm or less that needs so ensured. Same exactness is for the shooting direction. And, how you wanna shoot exactly with the same force?? So, the cue piston machine needs to be also tested how repeatable it can apply the cueball speed, and also the machine needs to be well fixed on the table in order to acchieve always exactly the same shooting direction.
Theoretically clear and easy, but practically very difficult to perform in my opinion.
standard templates placed like usual by hand, I guess that such a high exactness can not be acchieved for sure, we are talking here about a tolerance of ~ 0,1 mm or less that needs so ensured.
It isn't rocket surgery and people with all sorts of craziness inside them can have 'same rack' over and over again.