Lifecycle error doesnt appear in UI, only as internal error

there is a similar discussion, but it doesnt work for me.

When i create error as it is written in docs:

const { errors } = require("@strapi/utils");
const { ApplicationError } = errors;
...
async beforeCreate(event) {
    let okay = false;

    // Throwing an error will prevent the entity from being created
    if (!okay) {
      throw new ApplicationError("Something went wrong", 400);
    }
}

it is in the browser console, but doesnt show up in admin ui. my goal is to create custom validation in lifecycle in cases when it is not possible through admin page. then i want to show custom error to user in ui, so he would know why he cant save changes

there is a fresh issue on github that resolved my problem.

i needed to upgrade my strapi packages versions from 4.20.3 to 4.20.4