VersionControl.Provider.Checkout throws chmod error, but all code works

I’m at a bit of a loss here. I’m trying to get unity to check out a file before writing to it, all of which actually works fine. Except that it throws an error:

chmod: D:\Projects\ProjectName\english.json: The system cannot find the file specified.

Here’s my attempt at getting it to work properly:

UnityEditor.VersionControl.Asset asset = UnityEditor.VersionControl.Provider.GetAssetByPath(path);
            UnityEditor.VersionControl.Task status = UnityEditor.VersionControl.Provider.Status(asset);
            status.Wait();
            if (UnityEditor.VersionControl.Provider.CheckoutIsValid(status.assetList[0]))
            {
                UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(status.assetList[0], UnityEditor.VersionControl.CheckoutMode.Asset);
                task.Wait();
            }

The error is thrown at task.Wait().

The file it’s pointing to exists and in the lines after this it actually writes the correct text to the file.

Anyone got any idea what causes this?

Bumping this up, problem still exists in Unity 2017.2.0p4, whenever a file is not checked out yet this error will pop up. Once it’s checked out it will not show again.