When you name a bucket, whether it be an empty one, or a lava/water/milk-filled one, it will be named, but upon using the bucket (filling or emptying), it will lose the name that you originally gave it. Even if you bring it back to the bucket-type it was originally named as, it will revert to its item identity, rather than what you named it.
Related issues
Comments

Duplicate of MC-2194 , please use the search function to see if your bug has already been submitted. Currently over 30% of tickets are being closed as duplicate.