The .param commands seem to have difficulty with the SQLITE_DEFAULT_DEFENSIVE. If you define it as in #define SQLITE_DEFAULT_DEFENSIVE (to either 1 or 0) then the .param init does not create the temp.sqlite_parameters table. pragma trusted_schema=1; then allows the .param init to work, but you cannot set parameter values.
If SQLITE_DEFAULT_DEFENSIVE is undefined, then .param works normally even after pragma trusted_schema=0;
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.