Fix create new version ajax method on timeout

* Bug fix: WIP fix create new version ajax method when the operation takes
  too much time.
  [ghicaale refs #20193]
Merge remote-tracking branch 'collective/master'