Following late arrival on a Saturday afternoon, you may like to head down to Cardiff Bay (not a beach). Cardiff Bus number 6 is the most frequent and the stop in the city centre is on the south side of the central library (blue building).
On the Sunday, as well as Cardiff Castle and Bute Park, you should also be able to visit the National Museum of Wales - which is the big building with a dome E of the City Hall (which also has a dome).
Monday - the train is the quickest way to Caerphilly with around 4 or 5 services per hour - one of which goes non stop. However, if you get on a stopping service, you may wish to alight at Lisvane & Thornhill station and just take the 5 minute walk to enter Cefn-Onn-Park which is wonderful in May especially. (Good pub / restaurant next to entrance). Then, resume journey by train to Caerphilly. (The best view of the castle is from the outside from the SW).
You will save a lot of time if you can get a taxi from Caerphilly to Castell Coch. From Castell Coch back to the city - walk down the hill to Tongwynlais and get Stagecoach Bus 132 southbound.
As well as Cardiff Bus 32 to St. Fagans another company called First operate to St. Fagans (bus 320) via a slightly faster route. See and note the dates listed when events are taking place in Cardiff:>https://bustimes.org/services/320-talbot-green-bus-station-st-fagans-cardiff-wes
Here is the Cardiff Bus 32 schedule and be sure to note the mid afternoon departure of the last bus back to the city:> https://www.cardiffbus.com/services/CB/32
“Ocean side cliff walk via bus” - where?