How does outpainting work and how much it can do?

Hi everyone!
I have a question like the one mentioned in the title of the post. I am working on a project, where a transparent image of a fence would be given as a prompt and an AI image generator would suppose to create a background with a house or other objects. What’s important is that the given image of a fence can not be distorted and, if possible, should be extended on the image.
An example of a fence which would be subjected to outpainting is like this one:
połączenie_obu_rzeczy
So far, I have tested many AI image generators, including Midjourney, DALLE-2 and Playground AI (which IIRC uses Stable Diffusion). Result were mostly mixed. In most cases, AI would either create a distorted image, the fence would not look like the one showed above, or it would not properly extend it.
Like in the topic, my question is: how does outpainting work? From what I’ve seen, it generally does well where the whole image needs to be extended with an outpainting feature. But my test showed that it is much harder to do the same when there is only one small object given to outpaint around it.
And this lead me to the second question: how capable is not only DALLE-2 but every other AI image generator. Perhaps the idea I have is just impossible to be made or all I need is just the right prompt or a bit more details added to a fence (like a grassy background that would give more pixel to work on).
I’ve been dealing with this project quite some time now, and I would really appreciate any response that would clarify all the things I mentioned. :>