As described in spring-cloud/spring-cloud-gateway#3570 (comment) starting with Spring Boot 3.3.5, we are observing that HttpHeaders#writableHttpHeaders is failing to return a writable instance in case the given headers argument is an instance of Spring Security's org.springframework.security.web.server.firewall.StrictServerWebExchangeFirewall.StrictFirewallServerWebExchange.StrictFirewallHttpRequest.StrictFirewallHttpHeaders
This seems to be related to spring-projects/spring-security@0e257b5
I think it would be enough to cherry-pick ef77b40 to the branch 6.1.x