Hi there @David1 , welcome to the forum.
The code you provided can’t work as the caption parameter of figure does not accept an array like you provided.
You will need to use some custom function like flex-caption described here: How to have different text shown in figure caption and in outline? - #3 by flokl
Could I please ask you to edit your previous post and enclose your code in backticks ``` ?
This is a duplicate question.