I think this is normal? Local variable B overrides procedure B in symbol table, so you can't call it.
Theoretically, it shouldn't do that. The procedure name "B" is one level above the procedure's parameters (when there are any) and its local variables. The compiler is supposed to be able to figure out if "B" is a reference to the variable or procedure by looking at the token that follows "B" which will be different. A variable reference will be followed by either an assignment ":=", a field selector (.) or an index ([) selector whereas a procedure/function will be followed by either an open parenthesis or a semicolon. (I'm not sure if there are any other possibilities with FPC but, those would be the one's for standard Pascal.)
All that said, Delphi didn't compile it either but, it should compile (and work correctly, of course
)