Broadly, if a function updates the database and multiple rows are being acted upon, there is the potential that if the rows are picked up in A,B,C order they will return one result, but another if they are picked up in C,B,A order.
To ensure this doesn't happen, it errors out.

INSERT VALUES is a special case. It knows that the INSERT will only be for one row and that executing the function cannot affect the outcome of the INSERT.

Autonomous transactions can cause the same problems, which is why they should be treated with great caution.