I have the following text in a page. As you can see my shortcode is right at the bottom but somehow when the code runs, the output of my shortcode is inserted at the top of
You can use as alternative:
ob_start(); ...your code... return ob_get_clean();
and use without return the html as string.
Your shortcode handler is supposed to return the output to display in place of the shortcode, not output anything itself.
http://codex.wordpress.org/Shortcode_API