I got surprised similarly in a JSX at https://github.com/xwiki/xwiki-platform/pull/2981#discussion_r1820552737 . I could access the standard velocity macro, but it did not work properly because the xwikivars.vm context wasn't loaded.