We always travel up the day before as the train journey is about 6 hours, all being well. It is worth the piece of mind to pay for a hotel overnight than stress that the train is running late, will we get the connection, etc.
Just a couple of photos taken on my last visit to Sicily, last month and a brief evening trip into Palermo.
The first is Teatro Politeama Garibaldi and the second is the Teatro Massimo (don't know why it is upside down🤷♀️), both are walkable from the ship.
Venture Ashore are a company that organises excursions and they publish the arrival and departure timings, you just need to fill in your cruise details.
We sailed on Iona in January this year and the crossing was calm, but we were unable to dock in Maderia as the wind was too strong. As others have said it's the luck of the draw!