I'm not sure if this was caused by something specific to our multisite setup, #17 didn't work for us.
In our case, base_path() is coming through as '/uk/', and $path is an absolute URL including the host and scheme (https://site.example)
As such, $path does not start with /uk/, so the regex doesn't replace anything.
Uploading a new patch to handle as absolute URLs.
Updated #11 to fix "Entity queries must explicitly set whether the query should be access checked or not" errors in Drupal 10
Thanks jrockowitz, webform-repair fixed the underlying issue with missing/broken config so this patch isn't needed anymore.
Just realised there are a number of instances of preg_split with the same issue, so I've uploaded a new patch
JamieP → created an issue. See original summary → .