Gematria is allowed to be off by 1, because the word itself is counted as the missing 1. This rule is called kolel (and the words עם הכולל "with the kolel" are sometimes used to make clear that there is a difference of 1).
I'm not sure when this method of counting was first used, but the Leket Yosher (p. 3), citing the Trumat Hadeshen, brings a proof to this rule from Rashi's commentary on the word ונושנתם (Deuteronomy 4:25) that God did a favor to Israel by exiling them after 850 years, becaue if the Children of Israel were in the land of Israel for 852 years (the numerical value of ונושנתם), they would be "utterly destroyed" (4:26). The fact that they had to be exiled two years before 852, rather than one year, is a proof that the value can be off by one, because if they had been in the land for 851 years, they would have still been in danger of being "utterly destroyed" because it is within 1 of the value of 852, the value of ונושנתם. (This was sourced from Wikiyeshiva.)