I was studying this chapter lately, and this part of chapter always confuse me. I often think why $3d$ orbital in transition metal is higher in energy than 4s orbital? (the whole question will refer to transition elements). My confusion arises when I look at the explanation on a website (attached below), it says that because ionization energy always removes the electron from the highest, which mean that first removed electron is the last electron being put in the orbital, so I conclude that $4s$ is higher than 3d in transition element. But I found another website (attached below) stating that the highest orbital is $3d$. Now my question which one is the correct one?

First link: https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Supplemental_Modules_(Physical_and_Theoretical_Chemistry)/Electronic_Structure_of_Atoms_and_Molecules/Electronic_Configurations/The_Order_of_Filling_3d_and_4s_Orbitals

Second link: https://www.nextgurukul.in/questions-answers-forum/question/academic/quantam-numbers-for-the-last-electron-in-chromium/70432