Redocking last Tab causes exception below build 17763.
When a Tab is moved from the application to the desktop, it works fine. Other tabs may now also be moved to the new window. You may also move tabs back to the original window, but when you try to move the last desktop tab back to the main application window, an exception occurs in MainPage.xaml.cs Items_DragItemsCompleted.
Details:
System.ArgumentException HResult=0x80070057 Message=Value does not fall within the expected range. Source=<Cannot evaluate the exception source> StackTrace: at Windows.UI.Xaml.Controls.Primitives.Selector.put_SelectedIndex(Int32 value) at Microsoft.Toolkit.Uwp.UI.Controls.TabView.OnItemsChanged(Object e) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at TabViewTear.Views.MainPage.<Items_DragItemsCompleted>d__19.MoveNext()
For fun, I am going to try to fix it.
Thanks for the report @PaulaScholz, looks like an issue on builds before 17763, I'll have to spin up a VM after the holiday and take a look in more depth.
I would imagine this is a timing issue with the tab not being put back from the drag operation to remove again, there's some oddness with how dragging works there. I wonder if we dispatch the code in the DragItemsCompleted to the next cycle if it'd fix it or not.
No joy on the dispatch.

Interestingly, putting TabItems.RemoveAt(value); in a Try/Catch block and eating the exception clears up the behavior and the app then operates normally.
But, eating exceptions is no way to live your life. Unhandled exceptions taste horrible.
"If you eat the exception, it'll work." - Famous Last Words
I have the sample running on a 16299 VM and can repro the issue now. I was slowed down a bit by a toolkit issue, but I think I have a resolution for that.