Is there a limit to how many enemies can be attacked using the Hunter ranger’s Volley, Horde Breaker, and the second attack?

From other questions on here, I know that both Horde Breaker and Volley can be used together, as discussed here: Do the Hunter ranger's Horde Breaker and Volley features interact?

Is there any limit to how many enemies you can attack using this combo if they fall into the 10-foot radius of the initial Volley?

Say there is a shield-wall type of formation of enemies, all nicely lined up side by side and multiple rows deep. In theory, based on the phrasing of Volley, you can use Volley to attack every creature in the 10-foot radius, potentially attacking 16 targets – and you can use Horde Breaker on any that are within 5 feet of the point of origin. If the origin is the middle of the group, then possibly 8 additional targets – and then use Volley again for your second attack as a Hunter, making 40 total attack rolls in this situation (assuming they are all lined up nicely). Is this correct?

In my current campaign, we have stumbled into a war-torn region where large armies of Orcs are massing (my preferred enemy), and I’d love to use this loop hole if they end up lining up nicely for me.