The easiest solution is to just buy a ticket till Chiasso. Then just board the train, and then in Chiasso just stay on the train till Lugano, where you will change for the train to Luzern.
Note that the 12:43 is a regional train, for which you do not need to buy tickets in advance, and that is probably the issue you are facing, as buying tickets for mass transit months in advance is not something the system is designed for. So just buy that ticket at the station.