Hello @fede_galassi ,
Thanks for your post.
Are you using the FRDM-KL46Z as a programmer?
If so, how did you connect the FRDM-KL46Z to the MKE04Z8VWJ4? Could you provide more specific information? You can refer to Using the Freedom Board as SWD Programmer | MCU on Eclipse to check if there are connection issues.
You can also check the circuit connections of your custom board by referring to the schematic of FRDM-KE04, focusing on the power supply and SWD sections.
FRDM-KE04Z|FRDM Development Platform|Kinetis® MCU | NXP Semiconductors

Perhaps you can also use other external debuggers, such as JLINK or multilink, to eliminate interference factors.
Additionally, are you using our SDK? If you use the SDK to create an empty project, can it be programmed successfully?
Select Board | MCUXpresso SDK Builder
BRs,
Celeste
------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
------------------------------------------------------------------------------------------------------------------