nah that was written for the show. They don't really see each other much in the book.
I took it as a metaphor for the spontaneity of life. He spent all that time and energy trying to figure out why his cousin was crushing the beetles only to have him randomly die before he could figure it out. The viewer wants to know the answer and you don't get it because the reality is that we very seldomly get what we want in real life compared to what happens on television, the same way people wanted Oberyn to win, Robb to become king, Drogo to come to Westeros etc.
This was the end of the fight/chapter in the book if anyone's curious.
He never heard his father speak the words that condemned him. Perhaps no words were necessary. I put my life in the Red Viper’s hands, and he dropped it. When he remembered, too late, that snakes had no hands, Tyrion began to laugh hysterically.