"First line of OnSaved() method must be a call to base.OnSaved() otherwise CachedReferences will have a problem."
When overriding event handler methods in entity classes, you should invoke the base implementation. Otherwise you can accidentally skip any event handler code written in the parent class.
protected override async Task OnSaved(SaveEventArgs e)
{
if (SomeCondition) {...}
...
}
should be 🡻
protected override async Task OnSaved(SaveEventArgs e)
{
await base.OnSaved(e);
if (SomeCondition) {...}
...
}