If you have a header in the first line of intervals_of_interest.bed, use tail to strip it out, otherwise you will get a bogus result when using that file downstream:
$ awk '{print $1,'\t',$2,'\t',$3}' data/file.txt | tail -n+2 | sort-bed - > intervals_of_interest.bed
Also make sure that Heterochromatin.bed is sorted, if its sort order is unknown:
$ sort-bed Heterochromatin.unsorted.bed > Heterochromatin.bed
The subsequent bedmap command will return the unique ID values from the map file Heterochromatin.bed — values in the map file's fourth column — where there are overlaps with reference intervals:
$ bedmap --echo --echo-map-id-uniq intervals_of_interest.bed ../Heterochromatin.bed > answer.bed
If there are no overlaps between the reference interval of interest and the map file, you get an empty result, as your example run seems to correctly show.
If you want the file answer.bed to leave out intervals of interest from the result, where there are no overlaps with the map file (Heterochromatin.bed), add --skip-unmapped:
$ bedmap --echo --echo-map-id-uniq --skip-unmapped intervals_of_interest.bed ../Heterochromatin.bed > answer.bed
If you instead wanted (occupancy) signal or score data from the map file — values from the map file's fifth column — use --echo-map-score instead of --echo-map-id-uniq:
$ bedmap --echo --echo-map-score intervals_of_interest.bed ../Heterochromatin.bed > answer.bed
Again, add the --skip-unmapped option if you do not want the result to contain intervals-of-interest with no overlaps.
If you instead wanted to calculate a summary statistic from score data of overlapping map elements, like a mean or standard deviation, replace --echo-map-score with --mean, --stdev, etc., e.g.:
$ bedmap --echo --mean --skip-unmapped intervals_of_interest.bed ../Heterochromatin.bed > answer.bed
See bedmap --help or the online docs for a full listing of --echo-map-* and score-based statistical operations.