Its origin is unknown, though it is supposed that some accommodating magistrate, at some time or other resided on the opposite side of the River Bogie from that of the town or village inhabited by the lovers who desired to be joined in the bonds of matrimony without subjecting themselves to the sometimes inconvenient interrogations of the kirk. John Jamieson erroneously quotes the phrase as "ower boggie".
References
MacKay, Charles – A Dictionary of Lowland Scotch (1888)