Raspberry Pi is actively preventing enthusiasts from upgrading soldered memory to a larger configuration even when the replacement chip is technically compatible. The company says the restriction is intended to discourage unofficial high-capacity resales.
According to the article you can still do this. It’s just you can’t replace a 2 GB with an 8 GB because the board will still only recognize 2GB of that chip.
This is to prevent the resellers from buying 2 GB boards for cheap, replacing them with cheap 8 GB chips, and then reselling them for just under retail of the official 8 GB boards.
The article also states that you likely can’t use just any compatible chip, the part number is baked into the board, so you might not even be able to swap out a 2GB SK Hynix with a 2GB Samsung chip
it does not say part number is baked in. it says parameters are baked in (latencies, frequency), and so chips with a different part number might not work.