Most WCS servers can deliver only regular grids and in case of DEM data it means two dimensional grid (X and Y) where the height is an attribute of the grid points or cells. WCS server can support coverage data with more or less dimensions, for example dim=1 for a straight line, but WCS does not support trajectories.
The best you can do may be to make small rectangular requests which follow the route of your polyline and collect all the points/pixels that you need for the height profile. You need to fetch much more pixels from WCS that you really need, but still less than making one request with a huge rectangle, and with much less requests than by making a new GetCoverage for each point separately.
The new Environmental Data Retrieval (EDR) standard supports trajectories and corridors https://docs.ogc.org/is/19-086r5/19-086r5.html but there are very few servers and clients for EDR yet.