Window.records is undefined when logged to console

I have a custom code block on a list details page, and I’m running the following code:

<script>
window.addEventListener('block-loaded-client-details', (data) => {
	const recordId = getUrlParam('recordId');
	console.log(recordId);
	console.log(window);
	console.log(window.records);
});
</script>

The recordId gets logged correctly. The Window gets logged correctly and I can see a records index and then an index that matches the recordId, and inside of that I see fields that match all of the data that I am looking to use in my javascript.

However the window.records log is undefined. Can anyone tell me what I’m doing wrong here?