Moses got the Ten Commandments in Exodus. The events of Numbers come later.
Let us not blaspheme by accusing the Lord of being inconsistent.