Dateline raster rendering fails EPSG:3857

Description

I have a sample geotiff file in EPSG 3857 and trying to serve it as metatile through gwc while wrapping around dateline in Leaflet.
The source file and style are attached, as well as source code, by which I am converting from grib to geotiff:
gdalwarp -overwrite -tr 35000 35000 -t_srs EPSG:3857 --config CENTER_LONG 0 -wo SOURCE_EXTRA=80 -r bilinear -multi -wm 1000 -wo NUM_THREADS=2 -q -ot Float32 -dstnodata -9999 -co TILED=YES gfs.t06z.pgrb2.0p25.f001 gfs_weather_forecast.tif
The rendering transformations - contours and possibly arrows are rendered correctly, but raster colormap is not applied on the last tile on some zooms. See images for more clarity, please.
Zooms 1-3 work well, zooms 4-6 already lack color in the last metatile created and throws log warnings like this:
2018-12-12 16:16:41,499 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-1.7976931348623157E308 : 1.7976931348623157E308, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GridEnvelope2D[0..5, 0..412], PARAM_MT["Affine",
PARAMETER["num_row", 3],
PARAMETER["num_col", 3],
PARAMETER["elt_0_0", 35000.0],
PARAMETER["elt_0_2", 19845015.437619567],
PARAMETER["elt_1_1", -35000.0],
PARAMETER["elt_1_2", 218684.92582545057]]]
Advanced projection handling and dateline wrapping is turned on.
Here is a list of everything, that I have tried so far:
Serve this layer through leaflet standard wms without tiled=true - that made only the last tile containing a dateline without color.
With tiled=true the last metatile containing a dateline was without color.
As non-tiled WMS layer the color is not present everytime a dateline is somewhere in the current map area.
Wierdly enough, zooms 1-3 with tiled=true work well, even though they should also contain the dateline, which looks super wierd to me.
List of things, that did not help anyhow: Removing contours from style, Change of metatiling factor, Adding tilesorigin parameter, Changing layer bounding boxes to Compute from data, Compute from SRS bounds, other values.
Other issues, that are probably of similar or same nature and have been discussed recently:
https://sourceforge.net/p/geoserver/mailman/message/36492386/
I know that in order to get the problem fixed, I could code it myself, but I do know even basics of Java, therefore at least trying to document the issue thoroughly here.
Images:

Environment

GeoServer 2.14.0

Assignee

Andrea Aime

Reporter

Lubomír Bucek

Triage

Fix versions

Affects versions

Priority

Medium
Configure