Without having checked this, a problem could be that you’re not actually constructing a named tuple with (arr = arr). This expression assigns arr to arr, just within parentheses so it almost looks like a named tuple. For one element named tuples you either have to add a comma like (arr = arr,) or I think (; arr) also works, or the more verbose (;arr = arr)
That example is a bit hard to understand. Where does all_results come from? Your for loop overwrites beta and arr in each iteration, did you mean to collect elements?
Also, the syntax (all_results=all_results;beta=[beta]) is not correct for a named tuple, the semicolon can only go at the beginning, but you don’t even need that. The semicolon is for this convenience syntax:
a = 1
b = 2
julia> nt = (; a, b)
(a = 1, b = 2)
Then you’re passing a superfluous tuple to CSV.write, you don’t need the extra parentheses around the two arguments.
Last but not least, if you need to store a column which only consists of the same repeated scalar, try fill(value, number_of_elements) to create such a vector.