I have watched the replay of the kickoff multiple times, and have also read the NFL rulebook. As previously stated in this thread, a play ends when the player takes a knee. The official in the endzone stepped back from the ball when it was tossed his way because it was a live ball. The whistle had not been blown, so the play was not over. No where in the rule book does it state "giving yourself up". The NFL screwed up this call royally. I'm not saying the Bills would have won if the touchdown was not reversed-we will never know the answer to that.
But let's put this scenario in a different perspective. Let's say hypothetically the Bills are winning by 4 and are running out the clock. Time is stopped with 10 seconds left and Houston has no timeouts left. Josh just needs to take a knee and game over-right? Instead, Josh takes the snap, stands there for a couple of seconds, then throws the ball towards an official. The official backs away from the ball, and a Houston player picks it up and runs for a TD. Now, did Josh give himself up? Not according to NFL rules. Is it common sense that he meant to? Probably, but players and officials are not mind readers which is why they use signals and motions to convey what is going on. The receiver did not convey his intent by not taking a knee, thus the ruling on the field that it was a live ball and a Buffalo TD.