Answer
A Read-Only Custom Field's SQL needs to be a single SELECT expression, not a multi-statement PL/SQL block — reference the other entity's view (enabled as an Additional View on the target entity) and perform the addition directly inside the SELECT list, adding the source columns together as a single computed expression parameterized on the shared key, rather than trying to select values into variables and add them in separate statements.