Don't confuse the ScrollPane dimensions with the ScrollPane inner panel dimensions. There is no relation between the two.
The whole idea of using ScrollPane is that it allows you to set the internal width and height to larger values.
It is the same as ScrollView. The mistake you made is that you set the inner panel size to MainForm.Width and MainForm.Height. The correct size should be the absolute size of the internal layout.
ScrollPane1.LoadLayout("Layout2", 800, 1600)
The inner panel size shouldn't be resized. Never.
You need to decide on the size of Layout2 and set it. It if it is larger than the form size then the user will need to scroll it. This is exactly the reason for having a ScrollPane.