Good advice from Monbretia.
I purchased a house with a similar issue some years ago.
You can't buy the house unless the issue is resolved.
No one is going to resolve it except you.
First talk to the neighbour, there may well be a history. In my case the neighbour had a serious grudge against my vendor over the issue. Ask the neighbour how they see the situation could be resolved. Whatever they suggest go along with that, get an engineer to draw up plans detailing the agreement, get the solicitor to draw up a legally binging agreement to confirm the resolution. Then the bank may be willing to move.
You should get a serious discount for all this effort.
If the neighbour will not be some way reasonable, walk away.