what happens if you have two words like "heli" and "helicopter"? would you not be able to return true for helicopter since "heli" has a true attached to it and you would run into the 'true'? or would you be able to traverse further down the trie? and the "true" just denotes where words CAN end?
With the search function we are traversing the entire word first and then checking for isWord flag, so if you had helicopter it would bypass the isWord for heli. Have a look at the question 'word search II' on this channel, I go into more detail on how a trie works and you can edit the inputs in the console of leetcode to see for yourself.