Ketchup and similar "pasty sauces" are thixotropic. They are non-Neutonian liquids whose viscosity changes with different external factors. (Water and other "normal" Neutonian liquids have a constant viscosity.)
Thixotropic materials appear to be thick fluid which is difficult to get flowing. Once you do get it flowing, however, it sometimes flows too easily.
Inverting the bottle will allow gravity to work on the bulk of the contents over time. Smaller blobs are not affected due to another property of the stuff referred to as "shear thinning." Sometimes, swinging a bottle around in a circle to increase the "gravity" by centrifugal force is tried. If you do it hard enough, long enough, sometimes it works.
There's a more effective way.
Ketchup becomes more liquid with a minimum amount of stress applied to it in order to start. It is referred to as "yield stress." If less force is applied, nothing happens. At the yield stress point, however, the viscosity can drop as much as 1000 times! That's why you get a sudden glug of the stuff after hitting the base of a freshly opened bottle of it. You have found the yield stress point. This is the key to removing almost all of the contents.
Now: to extract the optimal amount of pasty stuff, try this (be patient):
Tip the bottle and tap it to drive the stuff to one side. Gradually increase the force of the taps until you find the amount of force (yield stress point) that works. Increasing the strength of the taps after that, won't work any better or faster. (I strike the bottle against the heel of the palm of my hand.) Larger blobs are easier to get flowing than small blobs. Maneuver large blobs toward smaller blobs to join them. Gradually, you can get practically all of the contents out this way.
Alternate method: If I can't get the contents out of the bottle, sometimes, I'll put other ingredients into it, shake to distribute the stuff and to coat everything before emptying the bottle.
And for the very frugal among us: To get the very last bit of precious material from its container, use a bit of something to dilute it. This won't affect the taste very much and the texture only slightly.