This is a followup to or restatement of a previous question, because I had a great deal of difficulty in understanding both the question and the answer. The example file had a lot going on, and I think it'll be easier to understand the answer if we use a simpler example.
So say I have a file, table.csv, as follows:
FirstName,LastName,Job
Bob,Builder,construction worker
Steve,Wumbo,Politician
Greembo,Flutes,Comedian
and a tex file, main.tex, as follows:
\documentclass{article}
\usepackage{tabularray}
\usepackage{datatool}
\DTLloaddb{table}{table.csv}
\begin{document}
\begin{tblr}{}
First name & Last name & Occupation \
\DTLforeach{table}{%
\firstname=FirstName,\lastname=LastName,\occupation=Job}{%
\firstname & \lastname & \occupation \}
\end{tblr}
\end{document}
When I try to compile this, lualatex fails, giving me the error
! Misplaced alignment tab character &.
<argument> ...ow\romannumeral \dtlforeachlevel }}\firstname &
\lastname & \occupation \...
l.15 \end
{tblr}
and spitting out a pretty bad looking table as a result.
Why is this happening, and what can I do to fix it?
I would really appreciate if the answer were not just a block of code but also included an explanation of the working code.

...eral \dtlforeachlevel }}\tl_build_put_right:Ne. – Canyon Dec 10 '23 at 20:21\tl_build_put_right:Neis fairly recent. An option is to update. Another option is to place\cs_generate_variant:Nn \tl_build_put_right:Nn { Ne }after\ExplSyntaxOn. – matexmatics Dec 11 '23 at 08:02