Using with isn’t going to tell you why it is failing, because it is like an if statement. Simply try {{ .Site.Data.homepage.head.animation }} in a template and let me know what you get. Does it give you the value you’re looking for?
On first glance your code looks like it should work. Do you have your code in a repo somewhere we can have a look at? Have a read about Requesting Help to see how you can help us help you.