The code works for me in the standard book environment. However for book it might be a good idea to change the \clearpage to \cleardoublepage to be certain that it does not change the floats.
Why it does not work for you is difficult to know? I would suggest that you make a copy of your book and remove all the hand painting and special stuff and see if you can get the index to work. If it works start adding back the hand painting and specials to it stops working :) Ingar