Well, you didn't check to see where exactly is generating the 400 response so this is just speculation, but if you change the Spring Boot version and the problem goes away, it could be coming from your Spring Boot app. Spring Boot embeds a server, defaults to Tomcat, into your application. This server will put limits on the header/cookie size like all servers do to prevent DoS attacks.
For Tomcat, it is:
maxHttpHeaderSize
The maximum size of the request and response HTTP header, specified in bytes. If not specified, this attribute is set to 8192 (8 KB).
https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Standard_Implementation
You could try bumping that up. With Spring Boot, the property to set is `server.max-http-header-size` (also defaults to 8K). That should apply to all embedded servers (Tomcat, Jetty, etc..).