I think I found I bug in the article. If you use the code as written in the SceneDelegate you will get a fatal error because the guard condition for the DetailViewController fails. After poking around in the documentation, it appears that there are newer methods on UISplitViewController to get the view controllers for the secondary panels as opposed to walking the view controller arrays. It appears that the view controller arrays are no longer laid out as the article indicates.
I made modifications to use viewController(for:) to get the DetailViewController and it works properly now.
I know the article is several years old and written for iOS 13 (the new methods appeared in iOS 14), but maybe a quick tweak to the article is in order?