Shortcode outputting at top of content

This happens when there is echoed output from the shortcode rather than the result being returned…

I’d wager nt_course_note_entry_field likely echoes rather than returns. If there is one – or you can create one) – use a similar function like nt_get_course_note_entry_field that does not echo.

If you can’t change the function you can wrap it in an output buffer and return the result that way, eg.

 ob_start();
 nt_course_note_entry_field();
 $result = ob_get_contents();
 ob_end_clean();
 return $result;