Upgrading Xiaomi HIMO C20 battery
As long as your ebike controller doesn't check if the "correct" (original) battery is installed you shouldn't have an issue replacing the 10ah battery with the20ah battery. If however it does check you could theoretically swap the BMS from the 20ah to the 10ah battery but this will most likely not be needed.

The difference in capacity shouldn't be an issue (when using both batteries) as long as both batteries (or at the least the smaller capacity battery) have a BMS (battery management system) or PCM (protection module) with a low voltage cutoff function (to prevent the cells from overdischarhing).