Whereas in mammals

Whereas in mammals the tiny tubes that convey nutrients to bone cells are arrayed in parallel lines, in birds the tubes form a random pattern.

What is the problem with the above sentence?

Well, the sentence should not start with “whereas”. This is more of a linking word between two sentences in a phrase! It usually follows after a comma!

I do not personally see any error. You could argue that stylistically there is a big distance between “Whereas” and the denouement at “… in birds”, but it is not incorrect, in my opinion.

“In mammals the tiny tubes that convey nutrients to bone cells are arrayed in parallel lines, whereas in birds the tubes form a random pattern.”
Is this sentence OK?

Yes, and stylistically people might prefer that.