The "CustomPotionEffects" tag contains the following:
byte | Id
byte | Amplifier
int | Duration
byte | Ambient
However, when using the /give, /summon, or /setblock commands that includes a potion using the "CustomPotionEffects" tag, all of the above 'byte' tags are incorrectly set to 'integer' on the item or entity. This can cause complications when attempting to apply the effect to a mob or player, notably the Amplifier.
This can be observed using the following command and checking its NBT data:
To confirm that the tag-types should be byte where listed, the /effect command can be used, which does apply the correct tag-types (save for Ambient, which it cannot apply):
For beacons, all tags are applied correctly, including the Ambient tag. Quick command to construct a minimal beacon pyramid for observation (in the north direction):
Relates slightly to https://mojang.atlassian.net/browse/MC-35127 except that one involves an always incorrect tag-type (not necessarily through commands), while the CustomPotionEffects tag-types are incorrectly applied through dataTags.