How to have different text shown in figure caption and in outline?

As an alternative, you can fully customize the text that will be shown in the outline with the following code which is taken from the Typst Examples Book.

#let in-outline = state("in-outline", false)
#show outline: it => {
  in-outline.update(true)
  it
  in-outline.update(false)
}

#let flex-caption(long, short) = context if in-outline.get() { short } else { long }

// And this is in the document.
#outline(title: [Figures], target: figure)

#figure(
  rect(),
  caption: flex-caption(
    [This is my long caption text in the document.],
    [This is short],
  )
)
Output