Fixes a bug I introduced through https://github.com/payloadcms/payload/pull/9396 and adds an e2e test