Well I genuinely wish you luck in my home city of Glasgow!
We have transport issues at the moment with a shortage of taxi drivers and train drivers. Trains are often cancelled just now
I suggest you make sure you have the Uber app downloaded in case you struggle getting a regular cab to take you back to the ship
You will also need a Perth taxi for your journey to the castle and I recommend you have that car stay at the castle as you could have a long wait for a car back to Perth
A return ticket Glasgow to Perth is almost £20 per head and would not give flexibility to stop at Stirling so I still think a private car would be better both in terms of time and cost. I hope you have a lovely day here