1) "sometimes"? What are you talking about? $gettok(%var1,%var2,32) always works, provided that %var2 is a number.
2) Again, what are you talking about?
//var %foo = one two three | echo -s $gettok(%foo,$rand(1,3),32)
Execute that command as many times as you like... it will never error.
Both your problems sound like an error on your part. Maybe if you posted a sample code that fails always we could sort it out.