There are rails all the way-they even also have trains on them and most likely the planner will not work as youre like so many waaaaaaaaaaaaay too early. For some global idea use a samedayofweek next week or so on bahn.de Forget that app as planner asap. Bahn.de is best for general EUR planning-but will also not show a thing if TrenItalia has not put anything in (remember that very 1st lesson on how computers work??)
It is indeed to Milano, then via/perhaps cambio in Genova along Liguria coast till border point Ventimiglia (20.000), then local SNCF=FR TER train, cannot even RES, ev 30/60 mins via Nice still along coast Mediterranee till Cannes or Grasse. makes also a stop in Monaco-but thats now in a tunnel without anyhting to see. Planners often also have specific trouble with these local trains.
You can in theory even do it without paying for RES=extra change in Verona and use InterRegionale, but even with IC the trip is not very speedy-can well take up to 10 hrs.
ALT-check timings yourself closer to travelday: direct Frecce till TORIno, then the quite scenic train via mountains to Tende-(train also for Ventimiglia), change there to only ¾ time daily TER to N.
In the past people looked at maps in timetables-these still have their merits. There are also bu quite unclear maps in the general info section of this site