its actually not a problem with the function, but with the way less is interpreting the file path of certain urls.
Those urls weren't loaded properly because they did point to an nonexistent file after being processed bei less.
This seems due to a change in Less which changes the handling of relative urls.
I tried finding another workaround but didn't find one for now.