Error Outputting Values Arduino Serial.print
There's two problems here.
First, you don't enter &quot;234&quot;, you enter &quot;2&quot; followed by &quot;3&quot; and finally &quot;4&quot;. Your really small timeout doesn't give the digits enough time to arrive.
Second, your line ending is being received and interpreted as &quot;not a number&quot; which is returned as 0 by .toInt().
What you need to do is:

Don't set a short timeout - you can remove that line entirely.
Use .readStringUntil('\n') to read up until your line ending in one go.