Calling commit in postgresql procedure throws error

Simple example (spring boot + liquibase + postgresql): GitHub - zeroWiNNeR/liquibase-procedure-commit-error-example

You can find changeset in src/main/resources/liquibase

Executing the patch throws error “Reason: liquibase.exception.DatabaseException: Error: invalid transaction termination on commit” but when i called this code from db console everything is ok. What could be the reason?