I believe Timer can only be triggered with a time.
Maybe you can calculate the required time from the current duration of a frame. If you used delta inside physicsprocess(delta) that should be a consistent value, or if you call it from _process(delta) delta that will vary based on current frame rate. I'm not sure about your use case but that should get you reasonable accuracy
If you really need an exact number of frames, it's probably easiest to just have your node initialise a counter when it is created and increment the counter each frame until it hits your target, then call your delete function.
extends Node (or whatever your node script extends)
var frame = 0
const max_frames = 40
if frame == max_frames: