Views isn't pulling custom field correctly
When using menu_get_object(), you'll get the node currently displayed from the menu. So for example, if you're on a page with a path like node/123, it will load the node with nid "123" (source). So that won't work inside a views for sure.

You should be able to retrieve the nid from the $entity element, which should be a parameter of your hook_field_formatter_view (as described here).