Transact-SQL
This is way beyond me to help out on the finer bits, but I would suggest a couple of things to try.
First, I don't find it clear why you used PRINT instead of SELECT. I know this is a different message, and it might be something strange.
Second, just whittle your proc down to:
CREATE PROCEDURE getBucketDetails
(
@installedVersion varchar(20),
@scriptFileCollection varchar(100) OUTPUT
) AS
SET @scriptFileCollection = 'your expected return'
--SELECT or
PRINT ' Final String :' + @scriptFileCollection
Then you can pretty much eliminate SQL server from the equation.
After that, good luck with the error message: "Stack around the variable 'scriptFile' corrupt."
There is a lot of stuff about this error message out on google (http://www.google.com/search hl=en&q=%22Stack+around+the+variable%22+corrupt) but could you be using the wrong type I pretty much thing Arnie has it right on the head. Should you return it to a SQLString and then cast it to your array