So time is running out and I don't see any solution for this.
User gautam pointed me in the right direction, which is why I am giving him the bounty, but I want to post the actual answer myself.
This is clearly a bug in the SP2013 version of the view selector functionality, which is setup in the actual webpart, not the view.
I'd also like to point out that this issue is not limited to SSOM or CSOM, it happens in both and it also happens in various types of views, such as Datasheet and Calendar, probably others.
The workaround is to trigger an update on the
DisableViewSelectorMenu webpart property, which can be achieved by manually editing the view webpart through the user interface, or programatically updating the property and the webpart, as shown below.
public void FixWebPartViewSelector(ClientContext context, string listTitle, string viewFileName)
Web web = context.Web;
List list = web.Lists.GetByTitle(listTitle);
context.Load(list, l => l.RootFolder);
string pageUrl = list.RootFolder.ServerRelativeUrl + "/Forms/" + viewFileName;
Console.WriteLine("Fixing view selector in: " + pageUrl);
File file = web.GetFileByServerRelativeUrl(pageUrl);
PersonalizationScope scope = Microsoft.SharePoint.Client.WebParts.PersonalizationScope.Shared;
LimitedWebPartManager wpm = file.GetLimitedWebPartManager(scope);
int numWebparts = wpm.WebParts.Count;
Console.WriteLine("Found " + numWebparts + " webparts!");
if(numWebparts == 1)
WebPartDefinition wpd = wpm.WebParts;
WebPart wp = wpd.WebPart;
//update view selector
wp.Properties["DisableViewSelectorMenu"] = false;
FixWebPartViewSelector(context, "Documents", "AllItems.aspx");
(Calendar) list views disappear from view selector menu of list view webpart
Programmatically created calendar view does not appear on view selector menu