because that template fragment you are trying to set using a custom template is being overridden by the fragment I listed, 014server_system_variables, it sets a number of my.cnf settings for mariadb settings..
Added: have a look at the my.cnf file, there are two entries for max_allowed_packet=
The last sets it, this is one created by the temp fragment 014server_system_variables