If you boil green beans, you should not directly enter into the boiled sugar. Wait until the green beans first and then enter the expanding sugar and salt to taste. If you enter the sugar together with the green beans green beans that will not expand.
For that there is a solution for ya green beans can expand when cooked that is by replacing the first boiling water that has sugar mixed with new water. Then the boiled green beans and boil again until fluffy. After boiling and fluffy strain and pour the green beans into boiling water first to have mixed the sugar.