What template file are you working in?
Is it a home page? Is the home page also acting as a blog home page (blog archive page)?
If so, then the global $post object is no actually the home page, it is one of the posts in the archive loop. You will need to specify the home page ID like so on the home page template:
where 123 is the home page ID