I just looked at the history of provided-mode-derived-p, and it seems that a fix had already been made for this problem. See commit 48ff4c0b2f7. (I am using emacs 26.3, which does not have this fix.) -- https://rrt.sc3d.org