How to justify a caption with a non-breaking space?

My caption happened to line break at a weird place so I wanted to add a non-breaking space. This what happened :

#show figure.caption: it => {
  set align(left)
  set par(justify: true)
  it
}

#figure(
  rect(width: 100%, height: 10%),
  caption : [#lorem(40)]
)
#figure(
  rect(width: 100%, height: 10%),
  caption : [This is a very long caption which breaks at the worst location possible like before a unit, 15 °C for example (in my language we have to space the value and the unit)]
)

#figure(
  rect(width: 100%, height: 10%),
  caption : [This is a very long caption which breaks at the worst location possible like before a unit, 15~°C for example (in my language we have to space the value and the unit)]
)

As you can see the line doesn’t adjust correctly in the third case. I suppose it’s a bug but I want to be sure it’s not something with my script.

The problem is that not all the space was used:

#show figure.caption: set block(stroke: 1pt)

You could fix it with the following.

#show figure.caption: set block(width: 100%)