If you ever bump into this error using Osmosis tool while extracting OSM.PBF polygon data:
org.openstreetmap.osmosis.core.OsmosisRuntimeException: File terminated prematurely without a section END record.
and you used a polygon created in this Polygon creation tool at https://polygons.openstreetmap.fr/ this is the solution for you.
Just be sure to edit that text file and add another “END” instruction at the end of the text file.
It seems that Osmosis incorrectly expects two END instructions for one polygon or that tool incorrectly just writes one END instead of two. However it is, this is going to fix this error and Osmosis will correctly generate your bounding-box extracted polygon.