get_children() not working properly – Only on one post?

The get_children function retrieves posts (an upoaded image is also a post) that are dependent on the post with a certain ID. An image becomes a child of a post when it is uploaded while editing that post. It does not become a child of a post when it is reused.

So if you are writing post A and upload image B, B will become a child of A. If you then write post C and include image B in a gallery, B will not become a child of C. If you use get_children on C, you will find nothing.

What you are looking for is get_post_galleries.