According to the Pernosco trace, https://static.pernos.co/server/7c640bc4ed587e824fab0ca8aa44f41d1b5595b5/rebuilding.html?redirect=https%3A%2F%2Fpernos.co%2Fdebug%2FAKTDVC62g_oHMo8GmtoA1g%2Findex.html, this is a case that the propagated BrowingContext has been discarded already, so it causes aBrowsingContext.GetMaybeDiscarded() get a nullptr.
This patch just check if the propageted BrowsingContext is discarded.
For the discarded BrowsingContext, try to use its BrowsingContextId to get the corresponding CanonicalBrowsingContext instead of using the propagated one.