There are a number of anecdotes in circulation among mathematicians about how dumb philosophers are about mathematics. Not all of these are deserved.
The story that Hegel claimed (in 1801) that it was a priori impossible that there be more than seven planets is one of these. The reality is definitely rather more interesting, and I think that to get the full picture I would have to read and understand Hegel's argument, which I have not yet done. I have not yet found the full text, and the original was in Latin. (“Quadratum est lex naturae,” says Hegel, “triangulum, mentis.” That's “the square is the law of nature; the triangle, of the mind.” Ummmm, okay.)
Another story tells that Kant claimed (1781) that Euclidean geometry was a priori correct and that a non-Euclidean geometry was not merely impossible but inconceivable. The claim of course is false, but I wonder how much of Kant's claim is really recognizable in there, and also how many mathematicians might have made similar claims in 1781.
Philosophy can be really tricky. Philosopher X seems to be saying Y, but then it turns out that you have misunderstood Y and it really means Z. Here's what the Stanford Encyclopedia of Philosophy says:
(Gray, Jeremy, "Epistemology of Geometry", The Stanford Encyclopedia of Philosophy (Fall 2017 Edition), Edward N. Zalta (ed.))
Okay, maybe? Gray continues:
Now I wonder if, where the whole situation explained to him, Kant would want to classify this theorem not as synthetic and a priori but as tautological, since the mathematician can only prove it by assuming that the triangle is in a Euclidean space.
I am willing to give Kant and Hegel the benefit of the doubt here. But if anyone is looking for a really good example of an indefensible mathematical fuckup by a first-class philosoper, check out this article I wrote about Thomas Hobbes a while back.