Your diagram is sloppy. There are at least five major groups of fish. The bony fish, class Osteichthyes, appeared late and are not our direct ancestors. They are cousins. Therefore, we are not descended from the bony fish, and their missing certain genes or possibly having others is irrelevent to our inheritance.
That's not my diagram. I'm simply reposting a tree of life diagram that was promoted by Evolutionists back in the 1960's.
To get to Mammals on that diagram, you must first go through "Fishes."
You've identified no other Evolutionary path to the contrary, by the way (nor can you).