What do Potions have to do with hatching eggs?
You cannot use potions on eggs.
The behavior you encounter is a result of how the Pokemon screen was built. When you look at your Pokemon, you can swipe left to view your eggs. This view is reused when you select a potion and are on the screen to select a Pokemon to use the item on. As a result, you can swipe to view eggs on the "potion use" screen, but you cannot use a potion on an egg.