In my opinion, you are right. This is a question that upsets many students, and I think they are right.
'The individual firm can sell ANY quantity as long as they sell at the equilibrium price' is a way of saying, but it isn't very rigorous.
The point of the question is about the horizontal line in correspondence of the market equilibrium price, about what is called 'the individual demand function’, in opposition to the 'market demand function'.
This line says simply that the price the firm faces is the same regardless of the quantity it supplies. That is, in formal terms, the price is a constant function of $Q$.
This does not mean that the firm actually can sell whatever quantity it wants: instead, maybe, it could be better to say that the firm chooses the optimal quantity 'as if' it could sell whatever quantity of product.
The core of the definition of a perfect competitive market is that a firm is price taker: in the sense that the firm believes that it can't affect the market price with its actions, in particular with the quantity it supplies, and takes the price as given. So, the price line is horizontal.
The fact that, at the market equilibrium price, the firm actually sells all the quantity it wants is an ex post consideration, that depends on the equilibrium assumption, not on the 'individual demand' being horizontal: if the price is at its equilibrium level, by definition, demand equals supply, so the plans of the agents are consistent, and the firm can sell the optimal quantity chosen in correspondence of that price.
If the firms made their optimal choices at a price different from equilibrium price, for example at a higher price, and the exchanges occurs out of equilibrium, they couldn't sell what they would.
But this depends on the fact of being outside equilibrium. The individual optimization problem would be, in the same way, on the basis of a horizontal 'individual demand', a horizontal line in correspondence of the non-equilibrium price: but evidently in this case firms cannot sell what they want, after optimization, even if the ‘individual demand curve’ is still horizontal.
We are in a context of equilibrium and of maximizing behaviour of the firms: these hypotheses are crucial to say that the firms can sell what they want. But suppose that the firm's owners go crazy, they stop optimizing and decide to produce at loss, supplying a big amount of product at the market equilibrium price: they can't sell what they want at the 'theoretical' equilibrium price of the market.
Nevertheless, their 'individual demand curve' is still horizontal.
These are just imaginative examples to remark the importance of both assumptions, optimizing behaviour and the fact that exchanges occur in equilibrium.