Paint bubbling and rust around the fuel filler door is a common E39 issue caused by inadequate factory drainage that allows water to accumulate; generally addressable by a body shop and not indicative of broader rust.
Gas-cap area rust and fuel filler corrosion
BMW E39 M5 · paint-and-body