When publishing a Web Scene to ArcGIS Online containing vertical 3D lines, those lines are missing when viewing the Scene in the Scene Viewer.
To conform to OGC standards, ArcGIS Online rebuilds the geometry of features with invalid geometry before storing it. Z and M values do not persist when ArcGIS Online rebuilds an invalid geometry.
OGC specifies a LineString as a feature containing two or more points, with linear interpolation between the points. This means that a straight-up vertical 'line' with two vertices with identical X and Y values is not actually a line, even if the elevation values are different. It is two points. Therefore, it is considered invalid geometry according to OGC standards and will be rebuilt by ArcGIS Online.
The data store used by ArcGIS Online requires geometry to be OGC-compliant. However, Portal for ArcGIS uses the internal Esri shape format which does not necessarily need to be OGC-compliant. Straight-up vertical lines are not treated as invalid geometry when published to Portal.