It is best to use a USB stick for the installer. Yes, it is possible to use a single hard drive for both the macOS installer and the full macOS installation (I have personally done this with macOS Ventura & Sonoma). However, you need to have a separate partition for each one. The partition for the full OS installation needs to be APFS (top option).
When you erased the external drive, did you erase the whole physical drive or just the existing volume? It is best to erase the whole physical drive in order to create a new partition table since drives from the factory may include some odd hidden partitions or other oddities that could affect some operating systems. See this Apple article for details since Disk Utility with macOS 10.13+ now defaults to hiding the physical drives from view by default:
Erase and reformat a storage device in Disk Utility on Mac - Apple Support
The destination volume for the full OS installation needs to be at least 100GB+ just for the base OS installation.....more storage is needed depending on the apps & data that will be stored on it. At least 20GB+ of Free storage space is always required for the normal operation of macOS (more depending on the workload).
Macs can be very picky about the drives used for booting. So there is a possibility the external drive may not be compatible.
Make sure to disconnect all other external devices in case one of them is causing a problem. Also, connect the external drive directly to the Mac.