The app won't allow you to book a ticket while you are in the train or close to the tracks or on the platform (Based on your phone's GPS), this is done specifically to prevent ticketless travellers from buying tickets only after spotting a TC or TTE. In that case if you are at the platform you need to use the QR code based ticket booking option in uts app.
After clicking on journey ticket by QR you need to scan the QR which is present at the station from which you want to book your general unreserved ticket. But since you won't be able to get off at the platform and search for this QR code and do the booking and get back to the train within that 2 min duration of the train halt, your only option is to find that station's QR code on Google and print it out beforehand and keep in your wallet.
Now when your train reaches that station beyond which you don't have reservation, just open uts app and click on book ticket using QR code and scan this code which you already have with you and then it won't show you the error of being too close to the station.
Once your unreserved ticket is booked, you can move to the unreserved compartment and continue your journey further.
Hope this clears your doubts and helps you travel hassle-free.