Never really tried this but my guess is APIs that does upload has limitation on overriding existing pbix files that are already uploaded. If via power bi desktop you do that your report / dataset in service gets overwritten maybe APIs don't have that capability yet. I would suggest you try renaming the file and then publish.