it is indeed a bug, which I think is caused by unity deserialisation. As there is no specific execution order, your awake function seems to be called at a random point where the text input is set, but before its awake is called. That is fine, and the code deals with it, except this seems to be calling awake before the text mesh game object is awakened. Basically the text mesh containing "0" is set to visible, but then gets turned off by the scene loader, which puts the textInput in an indeterminate state.
Easy fix - move your function from Awake to Start.