Bug introduced in 11.3 or earlier and persisting through 12.1 or later. Fixed in 13.0.0 or earlier
I didn't expect any difference between these:
dsa = {{{#@{3}}}, {{#@{2, 2}}}} &[Developer`ToPackedArray];
dsa[[All, 1, 1, -1]] = q;
dsa
{{{{q}}}, {{{q, 2}}}}
asd = {{{#@{3}}}, {{#@{2, 2}}}} &[Identity];
asd[[All, 1, 1, -1]] = q;
asd
{{{{q}}}, {{{2, q}}}}
What makes the differences?
Update: I reported it for version 12.0 and got a response confirming it is a bug.
dsa[[All, 1, 1, -1]]
are performed correctly in both cases. I would suggest to report it to Wolfram Support. $\endgroup$