In CASSANDRA-12838, the flags field of QUERY, EXECUTE and BATCH was changed from [byte] to [int]. The driver needs to account for that.
I have a working patch for that here that will create a PR from if that is acceptable.
Technically, flags should also be added for PREPARE as well for , so these two issues can probably be done together in one PR.
Althouh depending on the timing of CASSANDRA-10145, this might need to be done first since these changes are in 3.10, but that ticket won't land until 4.0.