I have no issues making the ISO with the modified kickstart. It is likely you have copied and pasted it with extra text/data on accident. It may be easier if you clone the kickstarts, make the changes yourself, and copy it into the mock chroot.
[nazu@router tmp]$ mock --quiet -r rocky-8-x86_64 --init
[nazu@router tmp]$ mock --quiet -r rocky-8-x86_64 --install lorax-lmc-novirt vim-minimal pykickstart git
[nazu@router tmp]$ egrep 'kmod|elrepo' /tmp/rocky-8-xfce-elrepo.ks
# elrepo repository - required for kmods
repo --name="elrepo" --baseurl=http://elrepo.org/linux/elrepo/el8/$basearch/ --cost=200
# elrepo packages
elrepo-release
kmod-sata_nv
kmod-forcedeth
[nazu@router tmp]$ sudo setenforce 0
[nazu@router tmp]$ sudo cp /tmp/rocky-8-xfce-elrepo.ks /var/lib/mock/rocky-8-x86_64/root/builddir/
[nazu@router tmp]$ mock -r rocky-8-x86_64 --shell --isolation=simple --enable-network
INFO: mock.py version 3.4 starting (python version = 3.6.8, NVR = mock-3.4-1.el8)...
Start(bootstrap): init plugins
INFO: selinux enabled
Finish(bootstrap): init plugins
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start(bootstrap): chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start(bootstrap): cleaning package manager metadata
Finish(bootstrap): cleaning package manager metadata
INFO: enabled HW Info plugin
Finish(bootstrap): chroot init
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
Finish: chroot init
Start: shell
<mock-chroot> sh-4.4# livemedia-creator --ks rocky-8-xfce-elrepo.ks \
> --no-virt \
> --resultdir /var/lmc \
> --project="Rocky Linux" \
> --make-iso \
> --volid Rocky-XFCE-8 \
> --iso-only \
> --iso-name Rocky-XFCE-8-x86_64-kmods.iso \
> --releasever=8 \
> --nomacboot
2023-01-07 13:26:04,870: livemedia-creator v28.14.70-1
2023-01-07 13:26:04,871: selinux is Disabled
/usr/lib/python3.6/site-packages/pykickstart/commands/partition.py:448: KickstartParseWarning: A partition with the mountpoint / has already been defined.
warnings.warn(_("A partition with the mountpoint %s has already been defined.") % pd.mountpoint, KickstartParseWarning)
2023-01-07 13:26:04,974: disk_img = /var/lmc/lmc-disk-ckcqocy8.img
2023-01-07 13:26:04,974: Using disk size of 6146MiB
2023-01-07 13:26:05,301: Running anaconda.
2023-01-07 13:26:09,874: Processing logs from ('127.0.0.1', 57990)
2023-01-07 13:26:09,950: Starting installer, one moment...
2023-01-07 13:26:09,950: terminal size detection failed, using default width
2023-01-07 13:26:09,950: anaconda 33.16.7.12-1.el8.rocky.0.1 for Rocky Linux 8 (pre-release) started.
2023-01-07 13:26:09,950:
2023-01-07 13:26:09,950: Some warnings occurred during reading the kickstart file:
2023-01-07 13:26:09,951: A partition with the mountpoint / has already been defined.
2023-01-07 13:26:09,951: 13:26:09 Not asking for VNC because of an automated install
2023-01-07 13:26:09,951: 13:26:09 Not asking for VNC because we don't have Xvnc
2023-01-07 13:29:16,919: Starting automated install......................
2023-01-07 13:29:16,920: ================================================================================
2023-01-07 13:29:16,920: ================================================================================
2023-01-07 13:29:16,920: Installation
2023-01-07 13:29:16,920:
2023-01-07 13:29:16,920: 1) [x] Language settings 2) [x] Time settings
2023-01-07 13:29:16,920: (English (United States)) (US/Eastern timezone)
2023-01-07 13:29:16,920: 3) [x] Installation source 4) [x] Software selection
2023-01-07 13:29:16,920: (https://download.rockylinux.org (Custom software selected)
2023-01-07 13:29:16,920: /stg/rocky/8/BaseOS/$basearch/os
2023-01-07 13:29:16,921: /)
2023-01-07 13:29:16,921: 5) [ ] User creation
2023-01-07 13:29:16,921: (No user will be created)
2023-01-07 13:29:16,921:
2023-01-07 13:29:16,921: ================================================================================
2023-01-07 13:29:16,921: ================================================================================
2023-01-07 13:29:16,921: Progress
2023-01-07 13:29:16,921:
2023-01-07 13:29:16,921: Setting up the installation environment
2023-01-07 13:29:16,921: ..
2023-01-07 13:29:16,922: Configuring storage
2023-01-07 13:29:18,921: ...
2023-01-07 13:29:18,921: Running pre-installation scripts
2023-01-07 13:29:18,921: .
2023-01-07 13:29:18,922: Running pre-installation tasks
2023-01-07 13:30:49,166: ..
2023-01-07 13:30:49,166: Installing.
2023-01-07 13:30:49,166: Starting package installation process
2023-01-07 13:30:49,166: Downloading packages
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 16.75 MiB / 1.44 GiB (1%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 47.48 MiB / 1.44 GiB (3%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 61.67 MiB / 1.44 GiB (4%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 69.3 MiB / 1.44 GiB (4%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 83 MiB / 1.44 GiB (5%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 131.93 MiB / 1.44 GiB (8%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 160.18 MiB / 1.44 GiB (10%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 189.83 MiB / 1.44 GiB (12%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 229.07 MiB / 1.44 GiB (15%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 259.18 MiB / 1.44 GiB (17%) done.
2023-01-07 13:30:49,167: Downloading 1048 RPMs, 290.71 MiB / 1.44 GiB (19%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 308.64 MiB / 1.44 GiB (20%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 344.61 MiB / 1.44 GiB (23%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 407.31 MiB / 1.44 GiB (27%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 469.94 MiB / 1.44 GiB (31%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 488.68 MiB / 1.44 GiB (33%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 493.8 MiB / 1.44 GiB (33%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 512.45 MiB / 1.44 GiB (34%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 540.13 MiB / 1.44 GiB (36%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 558.15 MiB / 1.44 GiB (37%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 577.57 MiB / 1.44 GiB (39%) done.
2023-01-07 13:30:49,168: Downloading 1048 RPMs, 597.14 MiB / 1.44 GiB (40%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 617.49 MiB / 1.44 GiB (41%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 652.15 MiB / 1.44 GiB (44%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 689.67 MiB / 1.44 GiB (46%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 765.8 MiB / 1.44 GiB (51%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 795.32 MiB / 1.44 GiB (53%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 894.47 MiB / 1.44 GiB (60%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 981.39 MiB / 1.44 GiB (66%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.04 GiB / 1.44 GiB (71%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.06 GiB / 1.44 GiB (73%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.08 GiB / 1.44 GiB (74%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.1 GiB / 1.44 GiB (76%) done.
2023-01-07 13:30:49,169: Downloading 1048 RPMs, 1.15 GiB / 1.44 GiB (79%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.18 GiB / 1.44 GiB (81%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.22 GiB / 1.44 GiB (84%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.25 GiB / 1.44 GiB (86%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.28 GiB / 1.44 GiB (88%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.33 GiB / 1.44 GiB (92%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.36 GiB / 1.44 GiB (94%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.38 GiB / 1.44 GiB (96%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.4 GiB / 1.44 GiB (96%) done.
2023-01-07 13:30:49,170: Downloading 1048 RPMs, 1.42 GiB / 1.44 GiB (98%) done.
2023-01-07 13:32:37,917: Preparing transaction from installation source
2023-01-07 13:32:37,918: Installing libgcc.x86_64 (1/1048)
. . .
2023-01-07 13:41:40,637: Verifying elrepo-release.noarch (1046/1048)
2023-01-07 13:41:40,637: Verifying kmod-forcedeth.x86_64 (1047/1048)
2023-01-07 13:41:40,637: Verifying kmod-sata_nv.x86_64 (1048/1048)
2023-01-07 13:41:40,981: .
2023-01-07 13:41:40,981: Installing boot loader
2023-01-07 13:41:40,983: ..
2023-01-07 13:41:40,983: Performing post-installation setup tasks
2023-01-07 13:41:41,992: .
2023-01-07 13:41:41,992: Configuring installed system
2023-01-07 13:41:48,080: ...................
2023-01-07 13:41:48,080: Creating users
2023-01-07 13:41:48,081: Configuring addons
2023-01-07 13:42:35,892: ..
2023-01-07 13:42:35,892: Generating initramfs
2023-01-07 13:42:35,956: ...
2023-01-07 13:42:35,956: Storing configuration files and kickstarts
2023-01-07 13:42:50,023: .
2023-01-07 13:42:50,023: Running post-installation scripts
2023-01-07 13:42:50,024: .
2023-01-07 13:42:50,024: Installation complete
2023-01-07 13:42:50,025:
2023-01-07 13:42:50,025: Use of this product is subject to the license agreement found at:
2023-01-07 13:42:50,025: /usr/share/rocky-release/EULA
2023-01-07 13:42:50,025:
2023-01-07 13:43:33,625: Shutting down log processing
2023-01-07 13:43:37,329: Disk Image install successful
2023-01-07 13:43:37,329: working dir is /var/tmp/lmc-work-bvu6ps6x
2023-01-07 13:47:41,705: Rebuilding initrds
2023-01-07 13:47:41,705: dracut args = ['--xz', '--add', 'livenet dmsquash-live convertfs pollcdrom qemu qemu-net', '--omit', 'plymouth', '--no-hostonly', '--debug', '--no-early-microcode']
2023-01-07 13:47:41,707: rebuilding boot/initramfs-4.18.0-425.3.1.el8.x86_64.img
2023-01-07 13:48:29,196: Building boot.iso
2023-01-07 13:48:29,265: running x86.tmpl
2023-01-07 13:48:40,171: Disk image erased
2023-01-07 13:48:41,309: SUMMARY
2023-01-07 13:48:41,309: -------
2023-01-07 13:48:41,309: Logs are in /builddir
2023-01-07 13:48:41,309: Results are in /var/lmc