I thought my experience today might be of interest. I am currently in Genova, Italy, and took a trip just along the coast to the nearby town of Camogli. Only €3.80 each way on frequent local trains. But I bought my ticket at a machine in Brignole station;: it offered ' Andata e ritorno' which turned out to be two singles. Despite the trains being mostly Regionale with no reserved seats, it insisted on my choosing a particular train, and by default it chose a train for my return journey which would have left a few minutes after my arrival. Had I been in less of a hurry I might have realised and checked that. Nevethrless I assumed that the ticket was valid for any train and convaildated it just before the one I actually caught. I'm sure that was fine and legal, but my ticket was not inspected in any case. I was just amused because this narrowing down of choices seems so similar to the behaviour of many British TOCs who seem reluctant to allow the flexibility of travel that we have always enjoyed. (PS, the ticket says clearly in capitals – and English, because I chose that language option on the machine – VALID ONLY ON THE SATE AND TRAIN SHOWN ON THE TICKET')
I've found that ticket machines sometimes give you a list of times of forthcoming relevant trains (since sometimes there are intercity - or whatever - doing the same journey at a higher price than the Regionali). But after choosing a ticket at the Regionali price, what's printed doesn't have a time on it - just a date. And, as already said, the information says to validate it before use and it then has several hours' validity.
However, your experience is different from what has always happened to me in the past. I assumed that perhaps you got a time printed on the ticket since it was just the earliest relevant train you could get. But it seems not - the "VALID ONLY..." message is rather alarming! However, since the ticket price will be the same for a journey like this whether you buy the ticket hours earlier or just before the train, perhaps it isn't a big problem
Except, if you're near a station and want to buy ahead of time if you expect to be in a rush and fear a queue at the machines,
and/or if you want to break your journey en route. (Though with fares based on distance, then the latter might not be a serious problem - several separate tickets would be about the same total amount as one through ticket.)
If this is evidence of a general switch to needing train-specific tickets even for little local journeys in Italy, then this is a pain. It's bad enough that British train companies trying this....