I just submitted https://github.com/vaadin/framework/issues/10734 which contains some simple code to illustrate what I believe to be a HorizontalLayout::setExpandRatio bug. Initial rendering of my example layout is fine:
But after the component (in this case a ProgressBar) with the expand ratio is updated, it suddenly becomes too wide: